[K2] Forbid to use "get class" in the context of string concat and equality

#KT-63941 Fixed
This commit is contained in:
Ivan Kylchik
2023-12-01 17:59:30 +01:00
committed by Space Team
parent 8a8eb18efd
commit 46cb108a23
8 changed files with 88 additions and 2 deletions
@@ -0,0 +1,11 @@
// FIR_IDENTICAL
annotation class Anno(val str: String)
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>"${A::class}"<!>)
class A
@Anno(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>B::class.toString()<!>)
class B
const val a = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>"${A::class}"<!>
const val b = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>B::class.toString()<!>