[FIR] Fix some Disappeared CLASS_LITERAL_LHS_NOT_A_CLASS
^KT-59931
This commit is contained in:
committed by
Space Team
parent
1dad890652
commit
9ab6353032
+2
-1
@@ -6,6 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.fir.analysis.checkers.expression
|
package org.jetbrains.kotlin.fir.analysis.checkers.expression
|
||||||
|
|
||||||
import org.jetbrains.kotlin.KtFakeSourceElementKind
|
import org.jetbrains.kotlin.KtFakeSourceElementKind
|
||||||
|
import org.jetbrains.kotlin.config.LanguageFeature
|
||||||
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
|
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
|
||||||
import org.jetbrains.kotlin.diagnostics.reportOn
|
import org.jetbrains.kotlin.diagnostics.reportOn
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||||
@@ -117,7 +118,7 @@ object FirClassLiteralChecker : FirGetClassCallChecker() {
|
|||||||
private fun ConeKotlinType.isAllowedInClassLiteral(context: CheckerContext): Boolean =
|
private fun ConeKotlinType.isAllowedInClassLiteral(context: CheckerContext): Boolean =
|
||||||
when (this) {
|
when (this) {
|
||||||
is ConeClassLikeType -> {
|
is ConeClassLikeType -> {
|
||||||
if (isNonPrimitiveArray) {
|
if (isNonPrimitiveArray && !context.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitGenericArrayClassLiteral)) {
|
||||||
typeArguments.none { typeArgument ->
|
typeArguments.none { typeArgument ->
|
||||||
when (typeArgument) {
|
when (typeArgument) {
|
||||||
is ConeStarProjection -> true
|
is ConeStarProjection -> true
|
||||||
|
|||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
// !LANGUAGE: +BareArrayClassLiteral +ProhibitGenericArrayClassLiteral
|
|
||||||
|
|
||||||
val a01 = Array::class
|
|
||||||
val a02 = Array<<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Array<!>>::class
|
|
||||||
val a03 = Array<Any?>::class
|
|
||||||
val a04 = Array<Array<Any?>?>::class
|
|
||||||
val a05 = Array<IntArray?>::class
|
|
||||||
val a06 = kotlin.Array::class
|
|
||||||
val a07 = kotlin.Array<IntArray?>::class
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +BareArrayClassLiteral +ProhibitGenericArrayClassLiteral
|
// !LANGUAGE: +BareArrayClassLiteral +ProhibitGenericArrayClassLiteral
|
||||||
|
|
||||||
val a01 = Array::class
|
val a01 = Array::class
|
||||||
|
|||||||
Reference in New Issue
Block a user