K2 Scripting: report error on attempt to use scripts in common roots

#KT-65967 fixed
This commit is contained in:
Ilya Chernikov
2024-02-20 12:05:36 +01:00
committed by Space Team
parent cdf4b17052
commit 10dbe73828
17 changed files with 168 additions and 3 deletions
@@ -0,0 +1,21 @@
-Xuse-fir-lt=false
-Xallow-any-scripts-in-source-roots
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
$TESTDATA_DIR$/src/c.kt
$TESTDATA_DIR$/src/s.kts
$TESTDATA_DIR$/src/s1.kts
$TESTDATA_DIR$/src/s2.kts
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xfragments=a
-Xfragments=b
-Xfragments=c
-Xfragment-sources=a\:$TESTDATA_DIR$/src/a.kt,a\:$TESTDATA_DIR$/src/s1.kts
-Xfragment-sources=b\:$TESTDATA_DIR$/src/b.kt,b\:$TESTDATA_DIR$/src/s2.kts
-Xfragment-sources=c\:$TESTDATA_DIR$/src/c.kt,c\:$TESTDATA_DIR$/src/s.kts
-Xfragment-refines=b\:a
-Xfragment-refines=c\:b
@@ -0,0 +1,13 @@
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!
error: script files in common source roots are not supported. Misplaced files:
compiler/testData/cli/jvm/hmpp/src/s1.kts
compiler/testData/cli/jvm/hmpp/src/s2.kts
COMPILATION_ERROR
+2
View File
@@ -0,0 +1,2 @@
val x = 42
+2
View File
@@ -0,0 +1,2 @@
val x = 42
+2
View File
@@ -0,0 +1,2 @@
val x = 42
@@ -0,0 +1,20 @@
-Xuse-fir-lt=false
-Xallow-any-scripts-in-source-roots
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
$TESTDATA_DIR$/src/c.kt
$TESTDATA_DIR$/src/s.kts
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xexpect-actual-classes
-Xfragments=a
-Xfragments=b
-Xfragments=c
-Xfragment-sources=a\:$TESTDATA_DIR$/src/a.kt
-Xfragment-sources=b\:$TESTDATA_DIR$/src/b.kt
-Xfragment-sources=c\:$TESTDATA_DIR$/src/c.kt,c\:$TESTDATA_DIR$/src/s.kts
-Xfragment-refines=b\:a
-Xfragment-refines=c\:b
@@ -0,0 +1,10 @@
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!
OK
@@ -0,0 +1,14 @@
-Xuse-fir-lt=false
-Xallow-any-scripts-in-source-roots
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt
$TESTDATA_DIR$/scripts/s.kts
$TESTDATA_DIR$/scripts/s1.kts
-Xcommon-sources=$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt,$TESTDATA_DIR$/scripts/s1.kts
-language-version
2.0
-cp
.
-d
$TEMP_DIR$
-XXLanguage\:+MultiPlatformProjects
@@ -0,0 +1,12 @@
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!
error: script files in common source roots are not supported. Misplaced files:
compiler/testData/cli/jvm/scripts/s1.kts
COMPILATION_ERROR
@@ -0,0 +1,15 @@
-Xuse-fir-lt=false
-Xallow-any-scripts-in-source-roots
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt
$TESTDATA_DIR$/scripts/s.kts
-Xcommon-sources
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
-language-version
2.0
-cp
.
-d
$TEMP_DIR$
-XXLanguage\:+MultiPlatformProjects
-Xexpect-actual-classes
@@ -0,0 +1,11 @@
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!
OK
+2
View File
@@ -0,0 +1,2 @@
val x = 42
+2
View File
@@ -0,0 +1,2 @@
val x = 42