kt8596.fir.kt 528 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE

// KT-8596 Rewrite at slice LEXICAL_SCOPE for nested class constructor reference in an argument position

class K {
    class Nested
}

fun foo(f: Any) {}

fun test1() {
    foo(K::Nested)
}

// KT-10567 Error: Rewrite at slice LEXICAL_SCOPE key: REFERENCE_EXPRESSION

class Foo(val a: String, val b: String)

fun test2() {
    val prop : Foo.() -> String = if (true) {
        <!UNRESOLVED_REFERENCE!>Foo::a<!>
    } else {
        <!UNRESOLVED_REFERENCE!>Foo::b<!>
    }
}