KT-5214 Annotation to provide platform name to avoid signature conflict

#KT-5214 Fixed
This commit is contained in:
Andrey Breslav
2014-06-10 14:10:49 +04:00
parent 43cac31722
commit 705a081919
21 changed files with 329 additions and 12 deletions
@@ -0,0 +1,16 @@
import kotlin.platform.*
fun <T> List<T>.foo() = "foo"
[platformName("fooInt")]
fun List<Int>.foo() = "fooInt"
fun box(): String {
val strings = listOf("", "").foo()
if (strings != "foo") return "Fail: $strings"
val ints = listOf(1, 2).foo()
if (ints != "fooInt") return "Fail: $ints"
return "OK"
}