[FE] Prohibit missed MUST_BE_INITIALIZED when there is no primary constructor

^KT-58472 Fixed
Review: https://jetbrains.team/p/kt/reviews/9967
This commit is contained in:
Nikita Bobko
2023-05-05 17:53:25 +02:00
parent ac40010501
commit de8c3826c2
41 changed files with 934 additions and 60 deletions
@@ -33,8 +33,8 @@ class SecondDerived : Second() {
override fun foo() = y
}
open class Third {
open var x: String
abstract class Third {
abstract var x: String
constructor() {
x = "X" // Non-final property access
@@ -33,8 +33,8 @@ class SecondDerived : Second() {
override fun foo() = y
}
open class Third {
open var x: String
abstract class Third {
abstract var x: String
constructor() {
<!DEBUG_INFO_LEAKING_THIS!>x<!> = "X" // Non-final property access
@@ -42,9 +42,9 @@ public final class SecondDerived : Second {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class Third {
public abstract class Third {
public constructor Third()
public open var x: kotlin.String
public abstract var x: kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -1,7 +1,7 @@
open class Base {
open var x: Int
abstract class Base {
abstract var x: Int
open var y: Int
abstract var y: Int
constructor() {
x = 42
@@ -9,6 +9,5 @@ open class Base {
val temp = this.x
this.x = y
y = temp
}
}
@@ -1,7 +1,7 @@
open class Base {
open var x: Int
abstract class Base {
abstract var x: Int
open var y: Int
abstract var y: Int
constructor() {
<!DEBUG_INFO_LEAKING_THIS!>x<!> = 42
@@ -9,6 +9,5 @@ open class Base {
val temp = this.<!DEBUG_INFO_LEAKING_THIS!>x<!>
this.<!DEBUG_INFO_LEAKING_THIS!>x<!> = <!DEBUG_INFO_LEAKING_THIS!>y<!>
<!DEBUG_INFO_LEAKING_THIS!>y<!> = temp
}
}
@@ -1,9 +1,9 @@
package
public open class Base {
public abstract class Base {
public constructor Base()
public open var x: kotlin.Int
public open var y: kotlin.Int
public abstract var x: kotlin.Int
public abstract var y: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String