Equality comparison for bound callable references takes into account bound receiver.

Fixed KT-14939: use expected receiver type when generating receiver code in get/set methods for bound property references.
Otherwise we have VerifyError for bound receiver 'null' of type 'Nothing?', which is mapped to 'java.lang.Void'.

TODO: proper equality comparison for property accessors ('x::prop.getter', 'x::prop.setter').
This commit is contained in:
Dmitry Petrov
2016-11-23 14:03:23 +03:00
parent ce6cf6475c
commit 3dd0c9d1c7
28 changed files with 525 additions and 20 deletions
@@ -9,8 +9,11 @@ enum class E {
fun box(): String {
val f = E.A::foo
val ef = E::foo
if (f() != "A") return "Fail 1: ${f()}"
if (f != E.B::foo) return "Fail 2"
if (f == E.B::foo) return "Fail 2"
if (ef != E::foo) return "Fail 3"
return "OK"
}