FIR checker: don't report errors on type parameter as LHS of class literals
If a type paramter is not reified or nullable, different errors will be reported by FirGetClassCallChecker. When determining whether type parameter wrapped in qualified access is a standalone expression or not, we examine whether the checker context has other qualified accesses in stack. Class literals (::class) is desugared to FirGetClassCall, and thus not stacked as qualified access. Since class literals are a special type of callable reference (a subtype of qualified access), we should keep track of FirGetClassCall in a similar way.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e29b40b07f
commit
bc2228d434
-3
@@ -1,3 +0,0 @@
|
||||
|
||||
fun <T: Any> dereferenceClass(): Any =
|
||||
<!TYPE_PARAMETER_AS_REIFIED!><!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>T<!>::class<!>
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
fun <T: Any> dereferenceClass(): Any =
|
||||
<!TYPE_PARAMETER_AS_REIFIED!>T::class<!>
|
||||
|
||||
Reference in New Issue
Block a user