Improve support of 'lateinit' modifier

- Allow 'lateinit' for inline classes which underlying type
is suitable for 'lateinit'

- K2: report all problems related to 'lateinit' modifier

^KT-55052: Fixed
This commit is contained in:
Vladislav Grechko
2022-11-18 03:22:17 +01:00
committed by teamcity
parent e0c13e5276
commit cd6e865fb3
35 changed files with 406 additions and 84 deletions
@@ -7,6 +7,9 @@ lateinit var kest by Delegate
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:9:5: error: 'lateinit' modifier is allowed only on mutable properties
lateinit val fest = "10"
^
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:9:5: error: 'lateinit' modifier is not allowed on properties with initializer
lateinit val fest = "10"
^
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:11:5: error: 'lateinit' modifier is not allowed on properties of a type with nullable upper bound
lateinit var xest: String?
^
@@ -16,6 +19,9 @@ compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:12:5: error: 'lateinit
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:13:5: error: 'lateinit' modifier is allowed only on mutable properties
lateinit val dest: String
^
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:13:5: error: 'lateinit' modifier is not allowed on properties with a custom getter or setter
lateinit val dest: String
^
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:18:5: error: 'lateinit' modifier is not allowed on properties of a type with nullable upper bound
lateinit var best: T
^