Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/receiverResolutionInLambda.kt
T
2020-03-24 18:58:17 +03:00

40 lines
782 B
Kotlin
Vendored

/*
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-37431
*/
class Case1() {
fun foo() {
val x = sequence<String> {
val y = this
//this is Case1 instead of SequenceScope<String>
yield("") // UNRESOLVED_REFERENCE
this.yield("") //UNRESOLVED_REFERENCE
this as SequenceScope<String>
yield("") // resolved to SequenceScope.yield
this.yield("") // resolved to SequenceScope.yield
}
}
}
fun case2() {
val x = sequence<String> {
val y = this
yield("") // UNRESOLVED_REFERENCE
this.yield("") //UNRESOLVED_REFERENCE
this as SequenceScope<String>
yield("") // UNRESOLVED_REFERENCE
this.yield("") // UNRESOLVED_REFERENCE
}
}