[Proposal] Select Case ? pattern
- Dominant language
- No language data
- Stars
- 328
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Description
I suggest to allow to composing the select case expr as a pattern using `?` like this:
```VB.NET
Dim X = "a test"
Select case X.StartsWith(?)
Case "a", "b"
Case "c"
Case Else
End Select
```
It will be lowered to:
```VB.NET
If X.StartsWith("a") OrElse X.StartsWith("b")
ElseIf X.StartsWith("c")
Else
End if
```
I also suggest to allow using members of the Select expr in the cases:
```VB.NET
Select Case X
Case "test"
Case .StartsWith("a")
Case Like "*s*"
Case .Contains("a")
Case .Substring(1, 2) = "ab"
End Select
```
the case will considered to have an embedded with applied on the case expr only not its body, and it will have effect over any outer with. The above syntax can be lowered to if statement.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.