Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039
Original commit: 903976d9af
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun A.AA.ext() {
|
fun A.AA.ext() {
|
||||||
x.hashCode()
|
x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun A.AA.ext() {
|
fun A.AA.ext() {
|
||||||
x?.hashCode()
|
x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun explicitRef() {
|
fun explicitRef() {
|
||||||
A.AA.x.hashCode()
|
A.AA.x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun explicitRef() {
|
fun explicitRef() {
|
||||||
A.AA.x?.hashCode()
|
A.AA.x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun implicitRef() {
|
fun implicitRef() {
|
||||||
A.x.hashCode()
|
A.x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun implicitRef() {
|
fun implicitRef() {
|
||||||
A.x?.hashCode()
|
A.x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import A.AA.x
|
import A.AA.x
|
||||||
|
|
||||||
fun importedMember() {
|
fun importedMember() {
|
||||||
x.hashCode()
|
x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import A.AA.x
|
import A.AA.x
|
||||||
|
|
||||||
fun importedMember() {
|
fun importedMember() {
|
||||||
x?.hashCode()
|
x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun A.AA.ext() {
|
fun A.AA.ext() {
|
||||||
x.hashCode()
|
x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun A.AA.ext() {
|
fun A.AA.ext() {
|
||||||
x?.hashCode()
|
x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun explicitRef() {
|
fun explicitRef() {
|
||||||
A.AA.x.hashCode()
|
A.AA.x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun explicitRef() {
|
fun explicitRef() {
|
||||||
A.AA.x?.hashCode()
|
A.AA.x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun implicitRef() {
|
fun implicitRef() {
|
||||||
A.x.hashCode()
|
A.x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun implicitRef() {
|
fun implicitRef() {
|
||||||
A.x?.hashCode()
|
A.x?.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import A.AA.x
|
import A.AA.x
|
||||||
|
|
||||||
fun importedMember() {
|
fun importedMember() {
|
||||||
x.hashCode()
|
x.length
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import A.AA.x
|
import A.AA.x
|
||||||
|
|
||||||
fun importedMember() {
|
fun importedMember() {
|
||||||
x?.hashCode()
|
x?.length
|
||||||
}
|
}
|
||||||
+3
-1
@@ -4,4 +4,6 @@ enum class Enum(x: String) {
|
|||||||
|
|
||||||
val becameNullable: Any = x
|
val becameNullable: Any = x
|
||||||
val unchanged: 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 becameNullable: Any? = x
|
||||||
val unchanged: Any = x
|
val unchanged: Any = x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Any.string() = this as String
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import Enum.*
|
import Enum.*
|
||||||
|
|
||||||
fun useBecameNullable(e: Enum) {
|
fun useBecameNullable(e: Enum) {
|
||||||
println(e.becameNullable.hashCode())
|
println(e.becameNullable.string())
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import Enum.*
|
import Enum.*
|
||||||
|
|
||||||
fun useBecameNullable(e: Enum) {
|
fun useBecameNullable(e: Enum) {
|
||||||
println(e.becameNullable?.hashCode())
|
println(e.becameNullable?.string())
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import Enum.*
|
import Enum.*
|
||||||
|
|
||||||
fun useUnchanged(e: Enum) {
|
fun useUnchanged(e: Enum) {
|
||||||
println(e.unchanged.hashCode())
|
println(e.unchanged.string())
|
||||||
}
|
}
|
||||||
+3
-1
@@ -1 +1,3 @@
|
|||||||
class B : A()
|
class B : A()
|
||||||
|
|
||||||
|
fun Any.string() = this as String
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun useA() {
|
fun useA() {
|
||||||
getA().x.hashCode()
|
getA().x.string()
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun useA() {
|
fun useA() {
|
||||||
getA().x?.hashCode()
|
getA().x?.string()
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun useB() {
|
fun useB() {
|
||||||
getB().x.hashCode()
|
getB().x.string()
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun useB() {
|
fun useB() {
|
||||||
getB().x?.hashCode()
|
getB().x?.string()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user