[FIR] Do not throw exception on unexpected FIR for constants

^KTIJ-23263 fixed

Merge-request: KT-MR-10699
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
This commit is contained in:
Egor Kulikov
2023-06-19 17:45:31 +00:00
committed by Space Team
parent e4f1c10bc1
commit 5bb4f469ef
6 changed files with 36 additions and 5 deletions
@@ -0,0 +1,4 @@
class InitOrderDemo(name: String) {
val (firstProperty = <expr>"First property"</expr>
}
@@ -0,0 +1,18 @@
KT element: KtStringTemplateExpression
FIR element: FirErrorPropertyImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
<ERROR PROPERTY: Destructuring declarations are only allowed for local variables/values>
FIR FILE:
FILE: [ResolvedTo(IMPORTS)] ktij23263.kt
[ResolvedTo(BODY_RESOLVE)] annotations container
public? final? [ResolvedTo(RAW_FIR)] class InitOrderDemo : R|kotlin/Any| {
public? [ResolvedTo(RAW_FIR)] constructor([ResolvedTo(RAW_FIR)] name: String): R|InitOrderDemo| {
LAZY_super<R|kotlin/Any|>
}
<ERROR PROPERTY: Destructuring declarations are only allowed for local variables/values>
}