[FIR] Support creation of IR of common + platform sources in FirAnalyzerFacade

This commit is contained in:
Dmitriy Novozhilov
2021-06-03 16:28:39 +03:00
committed by teamcityserver
parent df11ccf755
commit 37c096cb10
16 changed files with 173 additions and 32 deletions
@@ -0,0 +1,10 @@
$TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithError/jvm.kt
-Xcommon-sources
$TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
-Xuse-fir
-cp
.
-d
$TEMP_DIR$
-XXLanguage\:+MultiPlatformProjects
@@ -0,0 +1,20 @@
warning: advanced option value is passed in an obsolete form. Please use the '=' character to specify the value: -Xcommon-sources=...
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+MultiPlatformProjects
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: ATTENTION!
This build uses in-dev FIR:
-Xuse-fir
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:1: error: actual class 'A' has no corresponding members for expected class members:
/A.foo
actual interface A
^
COMPILATION_ERROR
@@ -0,0 +1,3 @@
expect interface A {
fun foo()
}
@@ -0,0 +1 @@
actual interface A
@@ -0,0 +1,10 @@
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt
-Xcommon-sources
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
-Xuse-fir
-cp
.
-d
$TEMP_DIR$
-XXLanguage\:+MultiPlatformProjects
@@ -0,0 +1,14 @@
warning: advanced option value is passed in an obsolete form. Please use the '=' character to specify the value: -Xcommon-sources=...
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+MultiPlatformProjects
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: ATTENTION!
This build uses in-dev FIR:
-Xuse-fir
OK
@@ -0,0 +1,5 @@
expect interface A {
fun foo(): String
}
fun getA(): A = null!!
@@ -0,0 +1,9 @@
actual interface A {
actual fun foo(): String
fun bar(): String
}
fun test(): String {
val a = getA()
return a.foo() + a.bar()
}