Fix collection literals resolve in gradle-based projects
#KT-19441 Fixed
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
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: 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] @AnnInt(intArrayOf(1, 2))
|
||||
[javac] ^
|
||||
|
||||
ERR:
|
||||
|
||||
BUILD FAILED
|
||||
[TestData]/build.xml:6: Compile failed; see the compiler error output for details.
|
||||
|
||||
Total time: [time]
|
||||
|
||||
Return code: 1
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<mkdir dir="${temp}/classes"/>
|
||||
<javac srcdir="${test.data}" destdir="${temp}/classes" includeantruntime="false">
|
||||
<classpath>
|
||||
<pathelement location="${kotlin.runtime.jar}"/>
|
||||
</classpath>
|
||||
<withKotlin>
|
||||
<compilerarg value="-Xallow-kotlin-package"/>
|
||||
</withKotlin>
|
||||
</javac>
|
||||
<jar destfile="${temp}/literals.jar">
|
||||
<fileset dir="${temp}/classes"/>
|
||||
</jar>
|
||||
|
||||
<java classname="lit.LiteralsKt" fork="true">
|
||||
<classpath>
|
||||
<pathelement location="${temp}/literals.jar"/>
|
||||
<pathelement location="${kotlin.runtime.jar}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package lit
|
||||
|
||||
annotation class AnnInt(val a: IntArray)
|
||||
|
||||
@Suppress("UNSUPPORTED_FEATURE")
|
||||
@AnnInt([1, 2])
|
||||
fun foo() {}
|
||||
|
||||
@AnnInt(intArrayOf(1, 2))
|
||||
fun bar() {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package kotlin
|
||||
|
||||
public fun intArrayOf(vararg elements: Int): FloatArray = TODO()
|
||||
Reference in New Issue
Block a user