dotnet / dotnet/vblang

[Proposal] Case ... When ... Clauses

Open
#24 1 comment 1 reaction 0 assignees View on GitHub
Discussion
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

[(Ported from Roslyn Repo)](https://github.com/dotnet/roslyn/issues/13440)

Is VB going to support patterns?
What about guard clauses? eg `Case ... .... When boolEpxr`
What about type matching and value manifesting? eg `TypeIs String As str`
How will tuple clause be handled?

``` vb
Select Case obj
Case TypeIs String As str When str IsNot Nothing
' do stuff
Case ( TypeIs Boolean As valid, TypeIs Int32 As i32 ) When ( valid AndAlso ( i32 > 0 ) )
' manifesting into Tuple(Of Boolean, Int32 ), which has named elements ( valid:= , i32:= )
End Select
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.