KT-52409 Report error when using K2 with multi-platform
This commit is contained in:
+7
@@ -104,6 +104,13 @@ object FirKotlinToJvmBytecodeCompiler {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (projectConfiguration.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) {
|
||||
messageCollector.report(
|
||||
CompilerMessageSeverity.ERROR,
|
||||
"K2 compiler does not support multi-platform projects yet, so please remove -Xuse-k2 flag"
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
val outputs = ArrayList<Pair<FirResult, GenerationState>>(chunk.size)
|
||||
val targetIds = projectConfiguration.get(JVMConfigurationKeys.MODULES)?.map(::TargetId)
|
||||
|
||||
@@ -11,11 +11,5 @@ compiler or generated code. Use it at your own risk!
|
||||
warning: ATTENTION!
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'public abstract actual interface A : R|kotlin/Any|' has no corresponding members for expected class members:
|
||||
|
||||
public abstract expect fun foo(): R|kotlin/Unit|
|
||||
|
||||
|
||||
actual interface A
|
||||
^
|
||||
error: k2 compiler does not support multi-platform projects yet, so please remove -Xuse-k2 flag
|
||||
COMPILATION_ERROR
|
||||
|
||||
@@ -11,4 +11,5 @@ compiler or generated code. Use it at your own risk!
|
||||
warning: ATTENTION!
|
||||
This build uses experimental K2 compiler:
|
||||
-Xuse-k2
|
||||
OK
|
||||
error: k2 compiler does not support multi-platform projects yet, so please remove -Xuse-k2 flag
|
||||
COMPILATION_ERROR
|
||||
|
||||
Reference in New Issue
Block a user