1bbcae5ed2
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier ^KT-54890 ^KTIJ-23587 fixed
41 lines
852 B
Kotlin
Vendored
41 lines
852 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
// ISSUE: KT-37070
|
|
|
|
class KotlinClass(private val name: String) : Comparable<KotlinClass> {
|
|
override operator fun compareTo(that: KotlinClass): Int {
|
|
return name.compareTo(that.name)
|
|
}
|
|
}
|
|
|
|
|
|
// TESTCASE NUMBER: 1
|
|
fun case1(kotlinClass: KotlinClass?) {
|
|
|
|
val value = kotlinClass?.let {
|
|
it
|
|
}
|
|
|
|
value.checkType { _<KotlinClass?>() }
|
|
|
|
val lambda = kotlinClass?.let {
|
|
{it}
|
|
}
|
|
|
|
lambda.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Function1<Unit, KotlinClass?>>() }
|
|
}
|
|
// TESTCASE NUMBER: 2
|
|
fun case2(kotlinClass: KotlinClass) {
|
|
|
|
val value = kotlinClass.let {
|
|
it
|
|
}
|
|
|
|
value.checkType { _<KotlinClass>() }
|
|
|
|
val lambda = kotlinClass.let {
|
|
{it}
|
|
}
|
|
|
|
lambda.checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Function1<Unit, KotlinClass?>>() }
|
|
}
|