[FIR] Always expand a type before checking it in FirConstChecks
The issue appeared when we analyzed some typealias. 1. The typealias itself could be valid, but it could point to an invalid type. 2. The typealias could point, for example, to an unsigned type that must be handled in a special way #KT-59894
This commit is contained in:
+2
-2
@@ -73,7 +73,7 @@ fun throwsSpreadArrayOfUnresolved() {}
|
||||
|
||||
typealias UEAlias = <!UNRESOLVED_REFERENCE!>UE<!>
|
||||
|
||||
@Throws(UEAlias::class)
|
||||
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>UEAlias::class<!>)
|
||||
fun throwsTypealiasToUnresolved() {}
|
||||
|
||||
interface Base0 {
|
||||
@@ -313,7 +313,7 @@ suspend fun suspendThrowsSpreadLiteralWithUnresolved() {}
|
||||
@Throws(*<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>arrayOf(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>UE<!>::class<!>)<!>)
|
||||
suspend fun suspendThrowsSpreadArrayOfUnresolved() {}
|
||||
|
||||
@Throws(UEAlias::class)
|
||||
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>UEAlias::class<!>)
|
||||
suspend fun suspendThrowsTypealiasToUnresolved() {}
|
||||
|
||||
@Throws(<!ARGUMENT_TYPE_MISMATCH!>Orphan::class<!>)
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
|
||||
typealias UI = UInt
|
||||
|
||||
const val a: UI = 1u
|
||||
const val b: UI = a
|
||||
const val c = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>a == b<!>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
public annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
|
||||
|
||||
typealias UEAlias = <!UNRESOLVED_REFERENCE!>UE<!>
|
||||
|
||||
@Throws(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>UEAlias::class<!>)
|
||||
fun throwsTypealiasToUnresolved() {}
|
||||
Reference in New Issue
Block a user