From 0a498660cb7c1189cf03fae4ba3df2b7317be8ce Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 11 Jul 2023 14:29:12 +0200 Subject: [PATCH] Run K2 scripts in PSI mode --- .../ant/jvm/additionalArguments/build.xml | 1 + .../ant/jvm/doNotFailOnError/build.log.expected | 12 ++++++++++++ .../integration/ant/jvm/doNotFailOnError/build.xml | 8 ++++++-- .../ant/jvm/failOnErrorByDefault/build.xml | 4 +++- .../testData/integration/ant/jvm/fork/build.xml | 1 + .../ant/jvm/forkOnError/build.log.expected | 9 +++++++++ .../integration/ant/jvm/forkOnError/build.xml | 2 ++ .../ant/jvm/jvmClasspath/build.log.expected | 3 --- .../integration/ant/jvm/mainInFiles/build.xml | 1 + .../ant/jvm/moduleNameWithKotlin/build.xml | 4 +++- .../build.log.expected | 13 +++---------- .../overloadResolutionOnCollectionLiteral/build.xml | 1 + .../build.log.expected | 3 --- .../jvm/twoStdlibForCollectionLiterals/build.xml | 1 + .../ant/jvm/withKotlinNoJavaSources/build.xml | 4 +++- .../build.log.expected | 2 +- .../ant/jvm/wrongCallForCollectionLiteral/build.xml | 1 + 17 files changed, 48 insertions(+), 22 deletions(-) diff --git a/compiler/testData/integration/ant/jvm/additionalArguments/build.xml b/compiler/testData/integration/ant/jvm/additionalArguments/build.xml index e751a767a76..01bcce8c2c4 100644 --- a/compiler/testData/integration/ant/jvm/additionalArguments/build.xml +++ b/compiler/testData/integration/ant/jvm/additionalArguments/build.xml @@ -11,6 +11,7 @@ + diff --git a/compiler/testData/integration/ant/jvm/doNotFailOnError/build.log.expected b/compiler/testData/integration/ant/jvm/doNotFailOnError/build.log.expected index bf3f570ca21..2d5c9b71d03 100644 --- a/compiler/testData/integration/ant/jvm/doNotFailOnError/build.log.expected +++ b/compiler/testData/integration/ant/jvm/doNotFailOnError/build.log.expected @@ -13,6 +13,12 @@ build: [javac] [TestData]/incorrectKotlinCode.kt:4:1: error: expecting ')' [javac] [javac] ^ + [javac] [TestData]/incorrectKotlinCode.kt:4:1: error: a type annotation is required on a value parameter + [javac] + [javac] ^ + [javac] [TestData]/incorrectKotlinCode.kt:3:1: error: function 'main' must have a body + [javac] fun main( + [javac] ^ [kotlinc] Compiling [[TestData]] => [[Temp]] [kotlinc] [TestData]/incorrectKotlinCode.kt:4:1: error: parameter name expected [kotlinc] @@ -23,6 +29,12 @@ build: [kotlinc] [TestData]/incorrectKotlinCode.kt:4:1: error: expecting ')' [kotlinc] [kotlinc] ^ + [kotlinc] [TestData]/incorrectKotlinCode.kt:4:1: error: a type annotation is required on a value parameter + [kotlinc] + [kotlinc] ^ + [kotlinc] [TestData]/incorrectKotlinCode.kt:3:1: error: function 'main' must have a body + [kotlinc] fun main( + [kotlinc] ^ BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/jvm/doNotFailOnError/build.xml b/compiler/testData/integration/ant/jvm/doNotFailOnError/build.xml index 8faf3e5e599..5fad10cf13d 100644 --- a/compiler/testData/integration/ant/jvm/doNotFailOnError/build.xml +++ b/compiler/testData/integration/ant/jvm/doNotFailOnError/build.xml @@ -3,9 +3,13 @@ - + + + - + + + diff --git a/compiler/testData/integration/ant/jvm/failOnErrorByDefault/build.xml b/compiler/testData/integration/ant/jvm/failOnErrorByDefault/build.xml index dbdd88c71d3..f94b7e2603b 100644 --- a/compiler/testData/integration/ant/jvm/failOnErrorByDefault/build.xml +++ b/compiler/testData/integration/ant/jvm/failOnErrorByDefault/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/jvm/fork/build.xml b/compiler/testData/integration/ant/jvm/fork/build.xml index 5dffa59b1db..9cfb23cf1df 100644 --- a/compiler/testData/integration/ant/jvm/fork/build.xml +++ b/compiler/testData/integration/ant/jvm/fork/build.xml @@ -20,6 +20,7 @@ + diff --git a/compiler/testData/integration/ant/jvm/forkOnError/build.log.expected b/compiler/testData/integration/ant/jvm/forkOnError/build.log.expected index 2d6555d5737..7e792863f17 100644 --- a/compiler/testData/integration/ant/jvm/forkOnError/build.log.expected +++ b/compiler/testData/integration/ant/jvm/forkOnError/build.log.expected @@ -9,6 +9,15 @@ build: [kotlinc] Compiling [[TestData]] => [[Temp]/fork.jar] [kotlinc] -Xms64m [kotlinc] -Xmx128m + [kotlinc] warning: ATTENTION! + [kotlinc] This build uses unsafe internal compiler arguments: + [kotlinc] + [kotlinc] -XXLanguage:+EnableDfaWarningsInK2 + [kotlinc] + [kotlinc] This mode is not recommended for production use, + [kotlinc] as no stability/compatibility guarantees are given on + [kotlinc] compiler or generated code. Use it at your own risk! + [kotlinc] [kotlinc] error: warnings found and -Werror specified [kotlinc] [TestData]/test.kt:4:15: warning: this cast can never succeed [kotlinc] println(0 as String) diff --git a/compiler/testData/integration/ant/jvm/forkOnError/build.xml b/compiler/testData/integration/ant/jvm/forkOnError/build.xml index e62ad865146..9629f0dd9e2 100644 --- a/compiler/testData/integration/ant/jvm/forkOnError/build.xml +++ b/compiler/testData/integration/ant/jvm/forkOnError/build.xml @@ -20,6 +20,8 @@ + + diff --git a/compiler/testData/integration/ant/jvm/jvmClasspath/build.log.expected b/compiler/testData/integration/ant/jvm/jvmClasspath/build.log.expected index cf8480a38b4..95e9fb48357 100644 --- a/compiler/testData/integration/ant/jvm/jvmClasspath/build.log.expected +++ b/compiler/testData/integration/ant/jvm/jvmClasspath/build.log.expected @@ -3,9 +3,6 @@ Buildfile: [TestData]/build.xml build: [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar] - [kotlinc] [TestData]/hello.kt:15:9: warning: variable 'result' is never used - [kotlinc] val result = "$a$c$e$f$j" - [kotlinc] ^ [java] OK BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/jvm/mainInFiles/build.xml b/compiler/testData/integration/ant/jvm/mainInFiles/build.xml index 7200da3b10b..520772e682b 100644 --- a/compiler/testData/integration/ant/jvm/mainInFiles/build.xml +++ b/compiler/testData/integration/ant/jvm/mainInFiles/build.xml @@ -4,6 +4,7 @@ + diff --git a/compiler/testData/integration/ant/jvm/moduleNameWithKotlin/build.xml b/compiler/testData/integration/ant/jvm/moduleNameWithKotlin/build.xml index 529fc1b4c2f..d9fe002a5df 100644 --- a/compiler/testData/integration/ant/jvm/moduleNameWithKotlin/build.xml +++ b/compiler/testData/integration/ant/jvm/moduleNameWithKotlin/build.xml @@ -4,7 +4,9 @@ - + + + diff --git a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected index b36190b633b..1dcfa7d93de 100644 --- a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected +++ b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected @@ -5,20 +5,13 @@ build: [mkdir] Created dir: [Temp]/classes [javac] Compiling 2 source files to [Temp]/classes [javac] Compiling [[TestData]] => [[Temp]/classes] - [javac] [TestData]/literals.kt:6:9: error: overload resolution ambiguity: - [javac] public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt - [javac] public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt - [javac] @AnnInt([1, 2]) - [javac] ^ - [javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity: - [javac] public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt - [javac] public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt + [javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity between candidates: [fun intArrayOf(vararg elements: IntArray): IntArray, fun intArrayOf(vararg elements: IntArray): IntArray] [javac] @AnnInt(intArrayOf(1, 2)) [javac] ^ - [javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt, public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt + [javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: [fun intArrayOf(vararg elements: IntArray): IntArray] [javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO() [javac] ^ - [javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt, public fun intArrayOf(vararg elements: Int): IntArray defined in kotlin in file myArrayOf.kt + [javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: [fun intArrayOf(vararg elements: IntArray): IntArray] [javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO() [javac] ^ diff --git a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.xml b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.xml index dfc95db6187..8edccf6f1f7 100644 --- a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.xml +++ b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.xml @@ -9,6 +9,7 @@ + diff --git a/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.log.expected b/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.log.expected index 86ebaf82fbc..fe13f0a5b7b 100644 --- a/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.log.expected +++ b/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.log.expected @@ -5,9 +5,6 @@ build: [mkdir] Created dir: [Temp]/classes [javac] Compiling 2 source files to [Temp]/classes [javac] Compiling [[TestData]] => [[Temp]/classes] - [javac] [TestData]/myArrayOf.kt:3:30: warning: parameter 'elements' is never used - [javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO() - [javac] ^ [javac] Running javac... [jar] Building jar: [Temp]/literals.jar diff --git a/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.xml b/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.xml index dfc95db6187..8edccf6f1f7 100644 --- a/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.xml +++ b/compiler/testData/integration/ant/jvm/twoStdlibForCollectionLiterals/build.xml @@ -9,6 +9,7 @@ + diff --git a/compiler/testData/integration/ant/jvm/withKotlinNoJavaSources/build.xml b/compiler/testData/integration/ant/jvm/withKotlinNoJavaSources/build.xml index 3b3c222aab9..0132508f8cd 100644 --- a/compiler/testData/integration/ant/jvm/withKotlinNoJavaSources/build.xml +++ b/compiler/testData/integration/ant/jvm/withKotlinNoJavaSources/build.xml @@ -4,7 +4,9 @@ - + + + diff --git a/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.log.expected b/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.log.expected index 805d02a9e6a..eef03e6b829 100644 --- a/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.log.expected +++ b/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.log.expected @@ -8,7 +8,7 @@ build: [javac] [TestData]/literals.kt:6:9: error: type mismatch: inferred type is FloatArray but IntArray was expected [javac] @AnnInt([1, 2]) [javac] ^ - [javac] [TestData]/literals.kt:9:9: error: type mismatch: inferred type is FloatArray but IntArray was expected + [javac] [TestData]/literals.kt:9:9: error: argument type mismatch: actual type is kotlin/FloatArray but kotlin/IntArray was expected [javac] @AnnInt(intArrayOf(1, 2)) [javac] ^ diff --git a/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.xml b/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.xml index dfc95db6187..8edccf6f1f7 100644 --- a/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.xml +++ b/compiler/testData/integration/ant/jvm/wrongCallForCollectionLiteral/build.xml @@ -9,6 +9,7 @@ +