From d62b045b0205c558bfff1448cb31d8751a08139a Mon Sep 17 00:00:00 2001 From: winscripter <142818255+winscripter@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:25:31 +0400 Subject: [PATCH] Fix generic parameter parsing issue 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 --- ILSourceParser/Parser.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ILSourceParser/Parser.cs b/ILSourceParser/Parser.cs index 3f5e78e..40d28ab 100644 --- a/ILSourceParser/Parser.cs +++ b/ILSourceParser/Parser.cs @@ -1148,9 +1148,9 @@ internal Parser 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(ParseGenericParameterPrimitive()) - .Or(ParseGenericParameterReference()) + from arg in ParseGenericParameterPrimitive() + .Or(ParseGenericParameterReference()) + .Or(ParseGenericParameterTypeConstraint()) .Token() from __ in Parse.Char(',').Optional().Token() select arg