Decrease resolution priority of declarations from kotlin-stdlib-jre7/8

In order to allow "overload resolution ambiguity" when both
kotlin-stdlib-jre7/8 and kotlin-stdlib-jdk7/8 are in the dependencies
This commit is contained in:
Alexander Udalov
2017-09-09 14:59:41 +03:00
committed by Ilya Gorbunov
parent 1592555783
commit a4f378d04d
8 changed files with 117 additions and 4 deletions
@@ -0,0 +1,10 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlinc] Compiling [[TestData]/main.kt] => [[Temp]/test.jar]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -0,0 +1,15 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlinc src="${test.data}/main.kt" output="${temp}/test.jar" nowarn="true">
<classpath>
<file file="${kotlin.stdlib.jre7.jar}"/>
<file file="${kotlin.stdlib.jre8.jar}"/>
<file file="${kotlin.stdlib.jdk7.jar}"/>
<file file="${kotlin.stdlib.jdk8.jar}"/>
</classpath>
<compilerarg line="-jvm-target 1.8"/>
</kotlinc>
</target>
</project>
@@ -0,0 +1,15 @@
import java.util.stream.Stream
import kotlin.streams.*
// kotlin-stdlib-jdk7
fun testUse(c: AutoCloseable) = c.use {}
// kotlin-stdlib-jdk8
fun testGet(c: MatchGroupCollection) = c.get("")
fun testGetOrDefault(c: Map<out Number, Any>) = c.getOrDefault(42, "")
fun testRemove(c: MutableMap<out Number, Any>) = c.remove(42, "")
fun testAsSequence(c: Stream<String>) = c.asSequence()