No syntax error when VB compiler generates skipped tokens for nullable ? syntax inside cref #2196
Labels
Area-Compilers
Bug
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
When I type the below code and turn on xml doc comment generation in the project settings, I noticed that
?
is actually parsed as a skipped token - which indicates that the syntax was erroneous. Yet the compiler gives me no warning (which means that the cref will not be emitted correctly).Integer?
withNullable(Of Integer)
, there is no longer any skipped tokens and no errors either. However, I am not sure whether this is legal - in C# we only allow unconstructed generic types in crefs (except when specifying parameter types) - so it is legal to say<see cref="Nullable{T}"/>
but it is not legal to say<see cref="Nullable{Integer}"/>
. In any case, if I inspect symbols forNullable(Of Integer)
andInteger
using the syntax visualizer, I can see that both identifiers bind correctly (see screenshot below). So I guess this must be legal in VB.Integer?
be legal too? Why does the parser skip the?
token? And why doesn't it produce any errors if this is illegal.Nullable(Of Something)
toSomething?
within crefs in VB quite difficult. (Looks like VB is inconsistent with C# here + the VB compiler is also inconsistent with itself w.r.t interchangeability of short and long form syntax for nullables.) But this also feels like it would impact any tools / extensions that want to do analysis within crefs.The text was updated successfully, but these errors were encountered: