[FIR] KT-54260: Fix the compiler crash

AllOpen plugin makes the properties all-open, but the annotation class
is left closed, because allopen for k2 literally checks
`classKind == CLASS`.

Since the properties are open, a
`NON_FINAL_MEMBER_IN_FINAL_CLASS` diagnostic is reported for them. It's
positioning strategy seeks for the explicit `open` modifier which is
not present.

The added test should not crash the compiler.

^KT-54260 Fixed
This commit is contained in:
Nikolay Lunyak
2022-11-17 10:54:34 +02:00
committed by teamcity
parent c79d65536b
commit 4b3dc008f0
7 changed files with 185 additions and 50 deletions
@@ -5,9 +5,7 @@
package org.jetbrains.kotlin.generators.tests
import org.jetbrains.kotlin.allopen.AbstractBytecodeListingTestForAllOpen
import org.jetbrains.kotlin.allopen.AbstractFirBytecodeListingTestForAllOpen
import org.jetbrains.kotlin.allopen.AbstractIrBytecodeListingTestForAllOpen
import org.jetbrains.kotlin.allopen.*
import org.jetbrains.kotlin.android.parcel.AbstractParcelBoxTest
import org.jetbrains.kotlin.android.parcel.AbstractParcelBytecodeListingTest
import org.jetbrains.kotlin.android.parcel.AbstractParcelIrBoxTest
@@ -274,6 +272,12 @@ fun main(args: Array<String>) {
testClass<AbstractFirBytecodeListingTestForAllOpen> {
model("bytecodeListing", excludedPattern = excludedFirTestdataPattern)
}
testClass<AbstractFirDiagnosticTestForAllOpen>() {
model("diagnostics", excludedPattern = excludedFirTestdataPattern)
}
testClass<AbstractFirDiagnosticsWithLightTreeTestForAllOpen>() {
model("diagnostics", excludedPattern = excludedFirTestdataPattern)
}
}
testGroup("plugins/noarg/tests-gen", "plugins/noarg/testData") {