diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/defaultUpperBound.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/defaultUpperBound.kt index 42a8b3ee6e8..9a4338ec29b 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/defaultUpperBound.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/defaultUpperBound.kt @@ -17,13 +17,13 @@ fun box(): String { val type = test() val x = type.arguments.single().type!!.classifier as KTypeParameter - val expected = className("kotlin", "Any?") + val expected = className("kotlin.Any?") assertEquals(expected, x.upperBounds.joinToString()) return "OK" } -fun className(qualifier: String, name: String): String { +fun className(fqName: String): String { val isJS = 1 as Any is Double - return if (isJS) name else "$qualifier.$name" + return if (isJS) fqName.substringAfterLast('.') else fqName } diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleClassParameter.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleClassParameter.kt index d535a38f1db..1ca557ee420 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleClassParameter.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleClassParameter.kt @@ -16,13 +16,13 @@ class C { } fun box(): String { - val fqn = className("test", "Container") + val fqn = className("test.Container") assertEquals("$fqn", C().notNull().toString()) assertEquals("$fqn", C().nullable().toString()) return "OK" } -fun className(qualifier: String, name: String): String { +fun className(fqName: String): String { val isJS = 1 as Any is Double - return if (isJS) name else "$qualifier.$name" + return if (isJS) fqName.substringAfterLast('.') else fqName } diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleFunctionParameter.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleFunctionParameter.kt index b55d1dc1125..865bc1fcd3a 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleFunctionParameter.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simpleFunctionParameter.kt @@ -14,13 +14,13 @@ fun notNull() = typeOf>() fun nullable() = typeOf>() fun box(): String { - val fqn = className("test", "Container") + val fqn = className("test.Container") assertEquals("$fqn", notNull().toString()) assertEquals("$fqn", nullable().toString()) return "OK" } -fun className(qualifier: String, name: String): String { +fun className(fqName: String): String { val isJS = 1 as Any is Double - return if (isJS) name else "$qualifier.$name" + return if (isJS) fqName.substringAfterLast('.') else fqName } diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simplePropertyParameter.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simplePropertyParameter.kt index 453372356d1..420cd95711b 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simplePropertyParameter.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/simplePropertyParameter.kt @@ -14,13 +14,13 @@ val X1.notNull get() = typeOf>() val X2.nullable get() = typeOf>() fun box(): String { - val fqn = className("test", "Container") + val fqn = className("test.Container") assertEquals("$fqn", "".notNull.toString()) assertEquals("$fqn", "".nullable.toString()) return "OK" } -fun className(qualifier: String, name: String): String { +fun className(fqName: String): String { val isJS = 1 as Any is Double - return if (isJS) name else "$qualifier.$name" + return if (isJS) fqName.substringAfterLast('.') else fqName } diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/upperBounds.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/upperBounds.kt index d5e75a2e458..f08a3eaa0d1 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/upperBounds.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/upperBounds.kt @@ -16,25 +16,25 @@ fun test() where X : Y?, Y : List, Z : Set fun box(): String { val type = test>?, MutableList>, Set>() - val containerNmae = className("test", "Container") + val containerNmae = className("test.Container") assertEquals("$containerNmae", type.toString()) val x = type.arguments.single().type!!.classifier as KTypeParameter assertEquals("Y?", x.upperBounds.joinToString()) val y = x.upperBounds.single().classifier as KTypeParameter - val listName = className("kotlin.collections", "List") + val listName = className("kotlin.collections.List") assertEquals("$listName", y.upperBounds.joinToString()) val z = y.upperBounds.single().arguments.single().type!!.classifier as KTypeParameter - val setName = className("kotlin.collections", "Set") - val stringName = className("kotlin", "String") + val setName = className("kotlin.collections.Set") + val stringName = className("kotlin.String") assertEquals("$setName<$stringName>", z.upperBounds.joinToString()) return "OK" } -fun className(qualifier: String, name: String): String { +fun className(fqName: String): String { val isJS = 1 as Any is Double - return if (isJS) name else "$qualifier.$name" + return if (isJS) fqName.substringAfterLast('.') else fqName }