[FIR] Fix processing constructors of sealed classes

- Allow declaring protected constructors in sealed classes
- Make default visibility of sealed class constructor `protected`

KT-44861
KT-44865
This commit is contained in:
Dmitriy Novozhilov
2021-02-11 13:20:03 +03:00
committed by TeamCityServer
parent 7c61ddc72b
commit 2d5b685535
47 changed files with 98 additions and 106 deletions
@@ -30,13 +30,13 @@ FILE: incompatibleModifiers.kt
}
public final class F : R|kotlin/Any| {
private constructor(): R|F| {
protected constructor(): R|F| {
super<R|kotlin/Any|>()
}
}
public sealed class G : R|kotlin/Any| {
private constructor(): R|G| {
protected constructor(): R|G| {
super<R|kotlin/Any|>()
}
@@ -57,7 +57,7 @@ FILE: incompatibleModifiers.kt
}
public sealed data class I : R|kotlin/Any| {
private constructor(i: R|kotlin/Int|): R|I| {
protected constructor(i: R|kotlin/Int|): R|I| {
super<R|kotlin/Any|>()
}
@@ -126,7 +126,7 @@ FILE: incompatibleModifiers.kt
}
public sealed inner class Z : R|kotlin/Any| {
private constructor(): R|X.Z| {
protected constructor(): R|X.Z| {
super<R|kotlin/Any|>()
}
@@ -6,7 +6,7 @@ FILE: redundantModifier.kt
}
public sealed class B : R|kotlin/Any| {
private constructor(): R|B| {
protected constructor(): R|B| {
super<R|kotlin/Any|>()
}
@@ -1,9 +1,9 @@
FILE: sealedClassConstructorCall.kt
public sealed class A : R|kotlin/Any| {
private constructor(): R|A| {
protected constructor(): R|A| {
super<R|kotlin/Any|>()
}
}
public final val b: R|A| = R|/A.A|()
public final val b: R|A| = <HIDDEN: /A.A is invisible>#()
public get(): R|A|
@@ -1,3 +1,3 @@
sealed class A
val b = <!SEALED_CLASS_CONSTRUCTOR_CALL{LT}!><!SEALED_CLASS_CONSTRUCTOR_CALL{PSI}!>A<!>()<!>
val b = <!HIDDEN{LT}!><!HIDDEN{PSI}!>A<!>()<!>
@@ -1,6 +1,6 @@
FILE: sealedSupertype.kt
public sealed class A : R|kotlin/Any| {
private constructor(): R|A| {
protected constructor(): R|A| {
super<R|kotlin/Any|>()
}
@@ -22,7 +22,7 @@ FILE: sealedSupertype.kt
}
public sealed class P : R|kotlin/Any| {
private constructor(): R|P| {
protected constructor(): R|P| {
super<R|kotlin/Any|>()
}