JVM_IR: do not generate main() when extension main is present

Extension methods with signature C.main() should not cause generation
of main(args: Array<String>).
This commit is contained in:
Georgy Bronnikov
2019-12-17 18:45:46 +03:00
parent 9d0c736f0e
commit 0d8036bb14
4 changed files with 18 additions and 1 deletions
@@ -3696,6 +3696,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("dontGenerateOnExtensionReceiver.kt")
public void testDontGenerateOnExtensionReceiver() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnExtensionReceiver.kt");
}
@TestMetadata("dontGenerateOnJvmNameMain.kt")
public void testDontGenerateOnJvmNameMain() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmNameMain.kt");