[FIR] Generate an error primary constructor when super call is invalid
Merge-request: KT-MR-11026 Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
This commit is contained in:
Vendored
+4
@@ -20,6 +20,10 @@ FILE: explicitDelegationCallRequired.kt
|
||||
|
||||
}
|
||||
public final class C : R|A| {
|
||||
public error_constructor(): R|C| {
|
||||
super<R|A|>(Int(20))
|
||||
}
|
||||
|
||||
public constructor(): R|C| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class B : A {
|
||||
|
||||
<!SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR!>class C : A(20) {
|
||||
<!EXPLICIT_DELEGATION_CALL_REQUIRED!>constructor()<!>
|
||||
constructor(z: String) : this()
|
||||
constructor(z: String) : <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>()
|
||||
}<!>
|
||||
|
||||
class D() : A(20) {
|
||||
|
||||
+9
@@ -6,6 +6,10 @@ FILE: interfaceWithSuperclass.kt
|
||||
|
||||
}
|
||||
public abstract interface B : R|A| {
|
||||
public error_constructor(): R|B| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface C : R|kotlin/Any| {
|
||||
}
|
||||
@@ -16,4 +20,9 @@ FILE: interfaceWithSuperclass.kt
|
||||
|
||||
}
|
||||
public abstract interface E : R|A|, R|C|, R|D| {
|
||||
public error_constructor(): R|E| {
|
||||
super<R|A|>()
|
||||
super<R|D|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+18
@@ -2,6 +2,10 @@ FILE: supertypeInitializedInInterface.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface B : R|A| {
|
||||
public error_constructor(): R|B| {
|
||||
super<R|A|>()
|
||||
}
|
||||
|
||||
}
|
||||
public open class C : R|kotlin/Any| {
|
||||
public constructor(): R|C| {
|
||||
@@ -10,8 +14,22 @@ FILE: supertypeInitializedInInterface.kt
|
||||
|
||||
}
|
||||
public abstract interface D : R|C| {
|
||||
public error_constructor(): R|D| {
|
||||
super<R|C|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface E : R|kotlin/Any| {
|
||||
public error_constructor(): R|E| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface F : R|A|, R|B|, R|C|, R|D|, R|kotlin/Any| {
|
||||
public error_constructor(): R|F| {
|
||||
super<R|B|>()
|
||||
super<R|D|>()
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
interface A
|
||||
|
||||
interface B : <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!>()
|
||||
interface B : <!SUPERTYPE_INITIALIZED_IN_INTERFACE!>A<!><!NO_CONSTRUCTOR!>()<!>
|
||||
|
||||
open class C
|
||||
|
||||
|
||||
+4
@@ -36,6 +36,10 @@ FILE: supertypeInitializedWithoutPrimaryConstructor.kt
|
||||
|
||||
}
|
||||
public final class G : R|C| {
|
||||
public error_constructor(): R|G| {
|
||||
super<R|C|>(Int(10))
|
||||
}
|
||||
|
||||
public constructor(): R|G| {
|
||||
super<R|C|>(Int(1))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user