Fix NPE on equals/hashCode for callable references without kotlin-reflect

#KT-11316 Fixed
 #KT-15847 Fixed
This commit is contained in:
Alexander Udalov
2017-02-03 01:45:24 +03:00
parent 0db60bf6cb
commit b784680fe2
13 changed files with 143 additions and 2 deletions
@@ -11,6 +11,9 @@ class M {
val bar = 1
}
fun topLevelFun() {}
val topLevelProp = ""
fun checkEquals(x: KCallable<*>, y: KCallable<*>) {
assertEquals(x, y)
assertEquals(y, x)
@@ -26,9 +29,15 @@ fun box(): String {
checkEquals(M::bar, M::bar)
checkEquals(::M, ::M)
checkEquals(::topLevelFun, ::topLevelFun)
checkEquals(::topLevelProp, ::topLevelProp)
checkToString(M::foo, "function foo")
checkToString(M::bar, "property bar")
checkToString(::M, "constructor")
checkToString(::topLevelFun, "function topLevelFun")
checkToString(::topLevelProp, "property topLevelProp")
return "OK"
}