FIR: don't create delegated constructor call in expect

#KT-51756 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-03-29 16:06:40 +03:00
parent 16027b4531
commit aaebb7a30e
12 changed files with 105 additions and 34 deletions
@@ -0,0 +1,31 @@
FILE: expectConstructor.kt
public open class Base : R|kotlin/Any| {
public constructor(v: R|kotlin/String|): R|Base| {
super<R|kotlin/Any|>()
}
}
public final expect class Derived : R|Base| {
public expect constructor(v: R|kotlin/String|): R|Derived|
}
public open expect class ExpectBase : R|kotlin/Any| {
public expect constructor(v: R|kotlin/String|): R|ExpectBase|
}
public final expect class ExpectDerived : R|ExpectBase| {
public expect constructor(v: R|kotlin/String|): R|ExpectDerived|
}
public open expect class IOException : R|kotlin/Any| {
public expect constructor(message: R|kotlin/String|, cause: R|kotlin/Throwable?|): R|IOException|
public expect constructor(message: R|kotlin/String|): R|IOException| {
super<R|kotlin/Any|>()
}
}
public final expect class EOFException : R|IOException| {
public expect constructor(message: R|kotlin/String|): R|EOFException|
}
@@ -0,0 +1,13 @@
open class Base(v: String)
expect class Derived(v: String) : Base
expect open class ExpectBase(v: String)
expect class ExpectDerived(v: String) : ExpectBase
expect open class IOException(message: String, cause: Throwable?) {
<!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>constructor(message: String)<!>
}
expect class EOFException(message: String) : IOException
@@ -1,9 +1,7 @@
Module: m1-common
FILE: common.kt
public open expect class A<T> : R|kotlin/Any| {
public expect constructor<T>(): R|A<T>| {
super<R|kotlin/Any|>()
}
public expect constructor<T>(): R|A<T>|
public open expect fun foo(arg: R|T|): R|kotlin/Unit|
@@ -1,9 +1,7 @@
Module: m1-common
FILE: common.kt
public open expect class A : R|kotlin/Any| {
public expect constructor(): R|A| {
super<R|kotlin/Any|>()
}
public expect constructor(): R|A|
public final expect fun foo(): R|kotlin/Unit|
@@ -1,9 +1,7 @@
Module: m1-common
FILE: common.kt
public open expect class A : R|kotlin/Any| {
public expect constructor(): R|A| {
super<R|kotlin/Any|>()
}
public expect constructor(): R|A|
public final expect fun foo(): R|kotlin/Unit|