Repoting platform declarations clashes in CLI compiler for JVM
#KT-1 In Progress
This commit is contained in:
+4
-1
@@ -328,6 +328,7 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
? null
|
? null
|
||||||
: IncrementalPackage.getPackagesWithRemovedFiles(
|
: IncrementalPackage.getPackagesWithRemovedFiles(
|
||||||
incrementalCacheProvider.getIncrementalCache(incrementalCacheDir), moduleId, environment.getSourceFiles());
|
incrementalCacheProvider.getIncrementalCache(incrementalCacheDir), moduleId, environment.getSourceFiles());
|
||||||
|
BindingTraceContext diagnosticHolder = new BindingTraceContext();
|
||||||
GenerationState generationState = new GenerationState(
|
GenerationState generationState = new GenerationState(
|
||||||
environment.getProject(),
|
environment.getProject(),
|
||||||
ClassBuilderFactories.BINARIES,
|
ClassBuilderFactories.BINARIES,
|
||||||
@@ -341,9 +342,11 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
configuration.get(JVMConfigurationKeys.ENABLE_INLINE, InlineCodegenUtil.DEFAULT_INLINE_FLAG),
|
configuration.get(JVMConfigurationKeys.ENABLE_INLINE, InlineCodegenUtil.DEFAULT_INLINE_FLAG),
|
||||||
packagesWithRemovedFiles,
|
packagesWithRemovedFiles,
|
||||||
moduleId,
|
moduleId,
|
||||||
new BindingTraceContext() // TODO
|
diagnosticHolder
|
||||||
);
|
);
|
||||||
KotlinCodegenFacade.compileCorrectFiles(generationState, CompilationErrorHandler.THROW_EXCEPTION);
|
KotlinCodegenFacade.compileCorrectFiles(generationState, CompilationErrorHandler.THROW_EXCEPTION);
|
||||||
|
AnalyzerWithCompilerReport.reportDiagnostics(diagnosticHolder.getBindingContext(),
|
||||||
|
environment.getConfiguration().get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY));
|
||||||
return generationState;
|
return generationState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-src
|
||||||
|
$TESTDATA_DIR$/signatureClash.kt
|
||||||
|
-output
|
||||||
|
$TEMP_DIR$
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class A {
|
||||||
|
fun getA(): Int = 1
|
||||||
|
val a: Int = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getB(): Int = 1
|
||||||
|
val b: Int = 1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
ERROR: $TESTDATA_DIR$/signatureClash.kt: (2, 5) Platform declaration clash: 'getA()I'
|
||||||
|
ERROR: $TESTDATA_DIR$/signatureClash.kt: (3, 5) Platform declaration clash: 'getA()I'
|
||||||
|
ERROR: $TESTDATA_DIR$/signatureClash.kt: (6, 1) Platform declaration clash: 'getB()I'
|
||||||
|
ERROR: $TESTDATA_DIR$/signatureClash.kt: (7, 1) Platform declaration clash: 'getB()I'
|
||||||
|
COMPILATION_ERROR
|
||||||
@@ -79,6 +79,11 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes
|
|||||||
doJvmTest("compiler/testData/cli/jvm/script.args");
|
doJvmTest("compiler/testData/cli/jvm/script.args");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("signatureClash.args")
|
||||||
|
public void testSignatureClash() throws Exception {
|
||||||
|
doJvmTest("compiler/testData/cli/jvm/signatureClash.args");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("simple.args")
|
@TestMetadata("simple.args")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
doJvmTest("compiler/testData/cli/jvm/simple.args");
|
doJvmTest("compiler/testData/cli/jvm/simple.args");
|
||||||
|
|||||||
@@ -56,4 +56,9 @@ public class K2JvmCliTest extends CliBaseTest {
|
|||||||
public void classpath() throws Exception {
|
public void classpath() throws Exception {
|
||||||
executeCompilerCompareOutputJVM();
|
executeCompilerCompareOutputJVM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void signatureClash() throws Exception {
|
||||||
|
executeCompilerCompareOutputJVM();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user