KT-10752: if (inferred) type for an expression refers to a Java class
non-accessible in the current context, it is a compiler error. Otherwise we might generate a CHECKCAST instruction that causes IAE at run-time. Here we are somewhat less permissive then Java (see inaccessibleType.kt in diagnostics tests).
This commit is contained in:
@@ -30,6 +30,5 @@ package other
|
||||
import test.My
|
||||
|
||||
class Your {
|
||||
// Ok but dangerous: internal vs package-private in different package
|
||||
internal fun bar() = My.foo()
|
||||
internal fun bar() = <!INACCESSIBLE_TYPE!>My.foo()<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user