Open richardwerkman opened 3 weeks ago
Is your feature request related to a problem? Please describe. The following code (in the switch expression) should be mutated but is not:
public void ListPatterns() { decimal balance = 0m; string[][] transactions = new[] { new[] { "1", "DEPOSIT", "100.00" }, }; foreach (string[] transaction in transactions) { balance += transaction switch { // "DEPOSIT" should be mutated here [_, "DEPOSIT", _, var amount] => decimal.Parse(amount), [_, "WITHDRAWAL", .., var amount] => -decimal.Parse(amount), [_, "INTEREST", var amount] => decimal.Parse(amount), [_, "FEE", var fee] => -decimal.Parse(fee), _ => throw new InvalidOperationException($"Record {string.Join(", ", transaction)} is not in the expected format!"), }; Console.WriteLine($"Record: {string.Join(", ", transaction)}, New balance: {balance:C}"); } }
Describe the solution you'd like We should introduce a new orchestrator for the syntax type ListPatternSyntax.
ListPatternSyntax
Is your feature request related to a problem? Please describe. The following code (in the switch expression) should be mutated but is not:
Describe the solution you'd like We should introduce a new orchestrator for the syntax type
ListPatternSyntax
.