Skip to content

Commit 96cb7d6

Browse files
fix enum parsing for methods
1 parent 3578ec0 commit 96cb7d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ArgumentSystem/Arguments/EnumArgument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static TryGet<object> Convert(BaseToken token, Script script, Type enumTy
5353
var stringRep = token.GetBestTextRepresentation(script);
5454

5555
// only allow exact matches or matches with the first letter not capitalized
56-
if (Enum.GetNames(enumType).Any(n => n.LowerFirst() == stringRep))
56+
if (Enum.IsDefined(enumType, stringRep))
5757
{
5858
return Enum.Parse(enumType, stringRep, true);
5959
}

0 commit comments

Comments
 (0)