[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
@@ -1,6 +1,6 @@
FILE: a.kt
public sealed class Base : R|kotlin/Any| {
private constructor(): R|Base| {
protected constructor(): R|Base| {
super<R|kotlin/Any|>()
}
@@ -1,6 +1,6 @@
FILE: exhaustiveness_sealedClass.kt
public sealed class Base : R|kotlin/Any| {
private constructor(): R|Base| {
protected constructor(): R|Base| {
super<R|kotlin/Any|>()
}
@@ -1,6 +1,6 @@
FILE: exhaustiveness_sealedObject.kt
public sealed class A : R|kotlin/Any| {
private constructor(): R|A| {
protected constructor(): R|A| {
super<R|kotlin/Any|>()
}
@@ -1,12 +1,12 @@
FILE: exhaustiveness_sealedSubClass.kt
public sealed class A : R|kotlin/Any| {
private constructor(): R|A| {
protected constructor(): R|A| {
super<R|kotlin/Any|>()
}
}
public sealed class B : R|A| {
private constructor(): R|B| {
protected constructor(): R|B| {
super<R|A|>()
}
@@ -18,13 +18,13 @@ FILE: exhaustiveness_sealedSubClass.kt
}
public sealed class D : R|B| {
private constructor(): R|D| {
protected constructor(): R|D| {
super<R|B|>()
}
}
public sealed class E : R|B| {
private constructor(): R|E| {
protected constructor(): R|E| {
super<R|B|>()
}