You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose that we split out the Is typeand IsNot type part from the TypeOf expr Is type, into it's own clause (IsTypeClause).
By doing this we'd gain additional forms, that are applicable to both TypeOf expression and a new Select Case Clause.
IsTypeClause ::= ("Is / IsNot") TypeSyntax ;;
Includee an optional declaration. IsTypeClause ::= ("Is" / "IsNot") (ident "As")? TypeSyntax ;;
Extend the target type to include multiple target types. IsTypeClause ::= ("Is" / "IsNot") (ident "As")? (TypeArgumentListSyntax / TypeSyntax)
Basic Syntax
Syntax IsTypeClause
Inherits ClauseSyntax
With
.KindOfIsKeyword As KeywordSyntax (Where .Kind IsOf {SyntaxKind.IsKeyword, SyntaxKind.IsNotKeyword})
.DeclarationAs As Optional(Of DeclarationAsClause)
.KIndOfTargetType As Union(Of TypeArgumentListSyntax, TypeSyntax)
End With
End Syntax
Syntax DeclarationAsClause
Inherits ClauseSyntax
With
.Declaration As IdentifierNameSyntax
.AsKeyword As KeywordSyntax (Where .Kind = SyntaxKind.AsKeyword)
End With
End Syntax
Syntax TypeOfExpression
Inherits Expression
With
.TypeOfKeyword As Keyword (Where .Kind = SyntaxKind.TypeOfKeyword)
.Operad As ExpressionSyntax
.IsTypeClause As IsTypeClauseSyntax
End With
End Syntax
KindOfIsKeyword
DeclarationAsClause
KindOfTarget
result
Is
Type
Valid
Is
id As
Type
Valid
Is
(Of T0 .., Tn)
Valid
Is
id As
(Of T0 .., Tn)
Error: DeclarationAsClause can not be used with TypeArgumentListSyntax.
IsNot
Type
Valid
IsNot
id As
Type
Error: DeclarationAsClause can not be used with IsNot.
IsNot
(Of T0..,Tn)
Valid
IsNot
id As
(Of T0..,Tn)
Error: DeclarationAsClause can not be used with TypeArgumentListSyntax. Error: DeclarationAsClause can not be used with IsNot.
Proposal 1: Is/Isnot Type Clauses
I propose that we split out the
Is type
andIsNot type
part from theTypeOf expr Is type
, into it's own clause (IsTypeClause
).By doing this we'd gain additional forms, that are applicable to both
TypeOf expression
and a newSelect Case Clause
.IsTypeClause ::= ("Is / IsNot") TypeSyntax ;;
Includee an optional declaration.
IsTypeClause ::= ("Is" / "IsNot") (ident "As")? TypeSyntax ;;
Extend the target type to include multiple target types.
IsTypeClause ::= ("Is" / "IsNot") (ident "As")? (TypeArgumentListSyntax / TypeSyntax)
Basic Syntax
Is
Is
id As
Is
(Of T0 .., Tn)
Is
id As
(Of T0 .., Tn)
IsNot
IsNot
id As
IsNot
.IsNot
(Of T0..,Tn)
IsNot
id As
(Of T0..,Tn)
Error: DeclarationAsClause can not be used with
IsNot
.Examples
Proposal 2: Is / IsNot Relational Clauses
This is would be a natural extension to an existing clause, by the use of the keyword
IsNot
as well asIs
in relational clauses.The text was updated successfully, but these errors were encountered: