Fix `--singlemethodname` (#78207)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Sun, 13 Nov 2022 23:44:30 +0000 (08:44 +0900)
committerGitHub <noreply@github.com>
Sun, 13 Nov 2022 23:44:30 +0000 (08:44 +0900)
Single method compilation mode broke with the change to use System.CommandLine. "Not specified" no longer means `null`.

src/coreclr/tools/aot/ILCompiler/Program.cs

index 91c8a13..fa843ed 100644 (file)
@@ -615,8 +615,7 @@ namespace ILCompiler
             if (method == null)
                 throw new CommandLineException($"Method '{singleMethodName}' not found in '{singleMethodTypeName}'");
 
-            if (method.HasInstantiation != (singleMethodGenericArgs != null) ||
-                (method.HasInstantiation && (method.Instantiation.Length != singleMethodGenericArgs.Length)))
+            if (method.Instantiation.Length != singleMethodGenericArgs.Length)
             {
                 throw new CommandLineException(
                     $"Expected {method.Instantiation.Length} generic arguments for method '{singleMethodName}' on type '{singleMethodTypeName}'");