Discriminate header classes in favor of non-header type aliases
In the test case, the problem was that Foo.a's type was resolved to the _class A_, which was written to metadata on JVM instead of the class AImpl with typealias A as an abbreviation. This metadata was incorrect because there's no class A from the JVM compiler's point of view; that's why the error "cannot access class A" was reported #KT-19151 Fixed
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
class Foo(val a: A? = null)
|
||||
|
||||
header class A
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
impl typealias A = AImpl
|
||||
|
||||
class AImpl {
|
||||
fun jvm(): A = this
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
val a = Foo().a?.jvm()
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
-- Common --
|
||||
Exit code: OK
|
||||
Output:
|
||||
|
||||
-- JVM --
|
||||
Exit code: OK
|
||||
Output:
|
||||
|
||||
-- JVM (2) --
|
||||
Exit code: OK
|
||||
Output:
|
||||
Reference in New Issue
Block a user