Skip to content

Commit

Permalink
Fix generic parameter parsing issue
Browse files Browse the repository at this point in the history
There is an issue with parsing generic parameters where a primitive type like int32 will not result in GenericParameterPrimitiveSyntax but rather GenericParameterTypeConstraintSyntax, and same with parameter references like !T. this was fixed in this commit
  • Loading branch information
winscripter authored Jul 24, 2024
1 parent 2bbd601 commit d62b045
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ILSourceParser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,9 +1148,9 @@ internal Parser<GenericArgumentsReferenceSyntax> ParseGenericArgsReference()
return from whitespace in ParseWhiteSpaceTrivia()
from args in (
from _ in ParseWhiteSpaceTrivia() // We don't use whitespace here, we just need to skip whitespace
from arg in ParseGenericParameterTypeConstraint()
.Or<BaseGenericParameterSyntax>(ParseGenericParameterPrimitive())
.Or(ParseGenericParameterReference())
from arg in ParseGenericParameterPrimitive()
.Or<BaseGenericParameterSyntax>(ParseGenericParameterReference())
.Or(ParseGenericParameterTypeConstraint())
.Token()
from __ in Parse.Char(',').Optional().Token()
select arg
Expand Down

0 comments on commit d62b045

Please sign in to comment.