Additional tests and fixes for function name mangling

This commit is contained in:
Dmitry Petrov
2018-08-22 15:04:44 +03:00
committed by Ilya Gorbunov
parent 99498eb7b8
commit a205019156
11 changed files with 55 additions and 16 deletions
@@ -11,6 +11,10 @@ fun Id.test() {
if (id != "OK") throw AssertionError()
}
fun Id?.test() {
if (this != null) throw AssertionError()
}
fun Name.test() {
if (name != "OK") throw AssertionError()
}
@@ -41,6 +45,7 @@ class Outer {
fun box(): String {
Id("OK").test()
null.test()
Name("OK").test()
test(Password("OK"))
@@ -0,0 +1,21 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR, JS, JS_IR
// WITH_REFLECT
import kotlin.reflect.KFunction
import kotlin.reflect.jvm.javaMethod
import kotlin.test.*
inline class InlineClass1(val s: String)
inline class InlineClass2(val n: Number)
fun <T : InlineClass1, U : InlineClass2> foo(t: T, u: U) {}
fun box(): String {
val fooRef: (InlineClass1, InlineClass2) -> Unit = ::foo
val fooMethod = (fooRef as KFunction<*>).javaMethod!!
assertEquals("[T, U]", fooMethod.genericParameterTypes.asList().toString())
return "OK"
}
@@ -1,5 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR, JS, JS_IR
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.*
@@ -3,8 +3,6 @@
// WITH_REFLECT
import kotlin.test.*
import kotlin.test.*
inline class S(val string: String)
fun test(s: S) {
@@ -1,5 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR, JS, JS_IR
// IGNORE_BACKEND: JVM_IR, JS
// WITH_RUNTIME
import kotlin.test.*