Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt
T
Denis Zharkov bc1b34a989 Add additional visibility check for synthetic extensions
Use extension receiver as dispatch one, because it is effectively dispatch
(after some desugaring)
2016-03-31 14:51:57 +03:00

31 lines
502 B
Kotlin
Vendored

// FILE: abc/A.java
package abc;
public class A {
protected void foo(Runnable x) {}
}
// FILE: main.kt
import abc.A;
class Data(var x: A)
class B : A() {
fun baz(a: A, b: B, d: Data) {
a.<!INVISIBLE_MEMBER!>foo<!> { }
b.foo { }
if (a is B) {
<!DEBUG_INFO_SMARTCAST!>a<!>.foo {}
}
if (d.x is B) {
d.x.<!INVISIBLE_MEMBER!>foo<!> {}
}
}
}
fun baz(a: A) {
a.<!INVISIBLE_MEMBER!>foo<!> <!TYPE_MISMATCH!>{ }<!>
}