FIR: copy constructor for typealias'ed inner/nested class

This commit is contained in:
Jinseong Jeon
2020-10-06 12:02:58 -07:00
committed by Denis Zharkov
parent 5e5712afbb
commit 8c88670185
7 changed files with 83 additions and 16 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Outer(val x: String) {
inner class Inner(val y: String) {
val z = x + y
@@ -7,7 +7,7 @@ class Outer {
typealias OI = Outer.Inner
fun test1(x: Outer) = x.<!UNRESOLVED_REFERENCE!>OI<!>()
fun test1(x: Outer) = x.OI()
class Generic<T> {
@@ -17,8 +17,8 @@ class Generic<T> {
typealias GI<T> = Generic<T>.Inner
typealias GIntI = Generic<Int>.Inner
fun test2(x: Generic<Int>) = x.<!UNRESOLVED_REFERENCE!>GI<!>()
fun <T> test3(x: Generic<T>) = x.<!UNRESOLVED_REFERENCE!>GI<!>()
fun <T> test4(x: Generic<List<T>>) = x.<!UNRESOLVED_REFERENCE!>GI<!>()
fun <T> test5(x: Generic<T>) = x.<!UNRESOLVED_REFERENCE!>GIntI<!>()
fun test2(x: Generic<Int>) = x.GI()
fun <T> test3(x: Generic<T>) = x.GI()
fun <T> test4(x: Generic<List<T>>) = x.GI()
fun <T> test5(x: Generic<T>) = x.<!INAPPLICABLE_CANDIDATE!>GIntI<!>()
fun Generic<Int>.test6() = GIntI()
@@ -26,9 +26,9 @@ class Outer {
}
typealias Test5 = Outer.Inner
val test5 = Test5()
val test5 = <!UNRESOLVED_REFERENCE!>Test5<!>()
val test5a = Outer.<!UNRESOLVED_REFERENCE!>Inner<!>()
val test5b = Outer.<!UNRESOLVED_REFERENCE!>TestInner<!>()
val test5c = Outer().<!UNRESOLVED_REFERENCE!>TestInner<!>()
val test5d = Outer().Inner()
val test5e = Outer().<!UNRESOLVED_REFERENCE!>Test5<!>()
val test5e = Outer().Test5()
+4 -3
View File
@@ -81,7 +81,8 @@ FILE fqName:<root> fileName:/kt16905.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> () returnType:IrErrorType
FUN name:test visibility:public modality:FINAL <> () returnType:<root>.Outer.Inner
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Unresolved name: OI>#' type=IrErrorType
RETURN type=kotlin.Nothing from='public final fun test (): <root>.Outer.Inner declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Outer.Inner' type=<root>.Outer.Inner origin=null
$outer: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Outer' type=<root>.Outer origin=null