Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039
This commit is contained in:
+3
-1
@@ -4,4 +4,6 @@ enum class Enum(x: String) {
|
||||
|
||||
val becameNullable: Any = x
|
||||
val unchanged: Any = x
|
||||
}
|
||||
}
|
||||
|
||||
fun Any.string() = this as String
|
||||
+3
-1
@@ -4,4 +4,6 @@ enum class Enum(x: String) {
|
||||
|
||||
val becameNullable: Any? = x
|
||||
val unchanged: Any = x
|
||||
}
|
||||
}
|
||||
|
||||
fun Any.string() = this as String
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
import Enum.*
|
||||
|
||||
fun useBecameNullable(e: Enum) {
|
||||
println(e.becameNullable.hashCode())
|
||||
println(e.becameNullable.string())
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
import Enum.*
|
||||
|
||||
fun useBecameNullable(e: Enum) {
|
||||
println(e.becameNullable?.hashCode())
|
||||
println(e.becameNullable?.string())
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import Enum.*
|
||||
|
||||
fun useUnchanged(e: Enum) {
|
||||
println(e.unchanged.hashCode())
|
||||
println(e.unchanged.string())
|
||||
}
|
||||
Reference in New Issue
Block a user