KT-7271 Accessing an extension property of Char.Companion leads to ClassNotFoundException in runtime
#KT-7271 Fixed
This commit is contained in:
@@ -25,6 +25,7 @@ fun testCompanionObjectAccess() {
|
||||
val l = Long
|
||||
val sh = Short
|
||||
val b = Byte
|
||||
val ch = Char
|
||||
val st = String
|
||||
val en = Enum
|
||||
}
|
||||
@@ -36,6 +37,7 @@ fun testInCall() {
|
||||
test(Long)
|
||||
test(Short)
|
||||
test(Byte)
|
||||
test(Char)
|
||||
test(String)
|
||||
test(Enum)
|
||||
}
|
||||
|
||||
+1
@@ -10,6 +10,7 @@ fun box(): String {
|
||||
|
||||
assertEquals("Companion", Int.Companion::class.simpleName)
|
||||
assertEquals("Companion", Double.Companion::class.simpleName)
|
||||
assertEquals("Companion", Char.Companion::class.simpleName)
|
||||
|
||||
assertEquals("IntRange", IntRange::class.simpleName)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ fun box(): String {
|
||||
val l = Long
|
||||
val sh = Short
|
||||
val b = Byte
|
||||
val ch = Char
|
||||
val st = String
|
||||
|
||||
test(Int)
|
||||
@@ -18,6 +19,7 @@ fun box(): String {
|
||||
test(Short)
|
||||
test(Byte)
|
||||
test(String)
|
||||
test(Char)
|
||||
|
||||
// Common Double
|
||||
Double.POSITIVE_INFINITY
|
||||
|
||||
@@ -32,6 +32,7 @@ private object IntCompanionObject {}
|
||||
private object LongCompanionObject {}
|
||||
private object ShortCompanionObject {}
|
||||
private object ByteCompanionObject {}
|
||||
private object CharCompanionObject {}
|
||||
|
||||
private object StringCompanionObject {}
|
||||
private object EnumCompanionObject {}
|
||||
@@ -32,6 +32,7 @@ private object IntCompanionObject {}
|
||||
private object LongCompanionObject {}
|
||||
private object ShortCompanionObject {}
|
||||
private object ByteCompanionObject {}
|
||||
private object CharCompanionObject {}
|
||||
|
||||
private object StringCompanionObject {}
|
||||
private object EnumCompanionObject {}
|
||||
|
||||
@@ -73,6 +73,12 @@ class CompanionObjectsExtensionsTest {
|
||||
assertEquals(java.lang.Byte.MIN_VALUE, Byte.MIN_VALUE)
|
||||
}
|
||||
|
||||
test fun charTest() {
|
||||
val ch = Char
|
||||
|
||||
assertEquals(ch, Char)
|
||||
}
|
||||
|
||||
test fun stringTest() {
|
||||
val s = String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user