mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Currently FirThisReceiverExpression of instance methods are translated to references of the class' thisReceiver, not the method's dispatch receiver, which causes problems with IrFrameMap::typeOf, as the class' thisReceiver is not in the typeMap. This commit translates non-qualified "this" references of instance methods to references of the methods' dispatch receiver.
17 lines
520 B
Kotlin
Vendored
17 lines
520 B
Kotlin
Vendored
data class A(val a: Any?, var x: Int)
|
|
data class B(val a: Any?)
|
|
data class C(val a: Int, var x: Int?)
|
|
data class D(val a: Int?)
|
|
|
|
fun box() : String {
|
|
if( A(null,19).hashCode() != 19) "fail"
|
|
if( A(239,19).hashCode() != (239*31+19)) "fail"
|
|
if( B(null).hashCode() != 0) "fail"
|
|
if( B(239).hashCode() != 239) "fail"
|
|
if( C(239,19).hashCode() != (239*31+19)) "fail"
|
|
if( C(239,null).hashCode() != 239*31) "fail"
|
|
if( D(239).hashCode() != (239)) "fail"
|
|
if( D(null).hashCode() != 0) "fail"
|
|
return "OK"
|
|
}
|