[FIR] allow primary constructors in interfaces to support invalid code

KTIJ-23504
This commit is contained in:
Anna Kozlova
2022-11-04 08:36:57 +01:00
parent ce94816d9e
commit 79bed083e6
17 changed files with 68 additions and 56 deletions
@@ -1,7 +1,21 @@
FILE: constructorInInterface.kt
public abstract interface A : R|kotlin/Any| {
public constructor(s: R|kotlin/String|): R|A| {
super<R|kotlin/Any|>()
}
public open val s: R|kotlin/String| = R|<local>/s|
public get(): R|kotlin/String|
}
public abstract interface B : R|kotlin/Any| {
public constructor(s: R|kotlin/String|): R|B| {
super<R|kotlin/Any|>()
}
public open val s: R|kotlin/String| = R|<local>/s|
public get(): R|kotlin/String|
}
public abstract interface C : R|kotlin/Any| {
public constructor(s: R|kotlin/String|): R|C| {
@@ -1,6 +1,6 @@
interface <!CONSTRUCTOR_IN_INTERFACE!>A(val s: String)<!>
interface A<!CONSTRUCTOR_IN_INTERFACE!>(val s: String)<!>
interface <!CONSTRUCTOR_IN_INTERFACE!>B constructor(val s: String)<!>
interface B <!CONSTRUCTOR_IN_INTERFACE!>constructor(val s: String)<!>
interface C {
<!CONSTRUCTOR_IN_INTERFACE!>constructor(s: String)<!> {}
@@ -12,6 +12,10 @@ FILE: typeAliasWithTypeArguments.kt
}
public abstract interface Inv<K, T> : R|kotlin/Any| {
public constructor<K, T>(): R|Inv<K, T>| {
super<R|kotlin/Any|>()
}
public abstract fun k(): R|K|
public abstract fun t(): R|T|
@@ -10,7 +10,7 @@ interface C {
fun baz()
}
interface <!CONSTRUCTOR_IN_INTERFACE!>Inv<K, T>()<!> {
interface Inv<K, T><!CONSTRUCTOR_IN_INTERFACE!>()<!> {
fun k(): K
fun t(): T
}