[FIR JS] KT-57822: Don't report the diagnostic for non-qualifiers
^KT-57822 Fixed
This commit is contained in:
committed by
Space Team
parent
375116dcf5
commit
077f49f33b
+4
@@ -27,6 +27,10 @@ object FirJsNativeRttiChecker : FirBasicExpressionChecker() {
|
|||||||
private fun checkGetClassCall(expression: FirGetClassCall, context: CheckerContext, reporter: DiagnosticReporter) {
|
private fun checkGetClassCall(expression: FirGetClassCall, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
val declarationToCheck = expression.argument.typeRef.toRegularClassSymbol(context.session) ?: return
|
val declarationToCheck = expression.argument.typeRef.toRegularClassSymbol(context.session) ?: return
|
||||||
|
|
||||||
|
if (expression.arguments.firstOrNull() !is FirResolvedQualifier) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (declarationToCheck.isNativeInterface(context)) {
|
if (declarationToCheck.isNativeInterface(context)) {
|
||||||
reporter.reportOn(expression.source, FirJsErrors.EXTERNAL_INTERFACE_AS_CLASS_LITERAL, context)
|
reporter.reportOn(expression.source, FirJsErrors.EXTERNAL_INTERFACE_AS_CLASS_LITERAL, context)
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-57822
|
||||||
|
|
||||||
|
external interface Foo
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
foo()::class.simpleName
|
||||||
|
}
|
||||||
|
|
||||||
|
external fun foo(): Foo
|
||||||
+6
@@ -30,6 +30,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicUnresolved.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicUnresolved.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("externalInterfaceClassLiteral.kt")
|
||||||
|
public void testExternalInterfaceClassLiteral() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/externalInterfaceClassLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("funConstructorCallJS.kt")
|
@TestMetadata("funConstructorCallJS.kt")
|
||||||
public void testFunConstructorCallJS() throws Exception {
|
public void testFunConstructorCallJS() throws Exception {
|
||||||
|
|||||||
+6
@@ -31,6 +31,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
|
|||||||
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicUnresolved.kt");
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicUnresolved.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("externalInterfaceClassLiteral.kt")
|
||||||
|
public void testExternalInterfaceClassLiteral() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithJsStdLib/externalInterfaceClassLiteral.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("funConstructorCallJS.kt")
|
@TestMetadata("funConstructorCallJS.kt")
|
||||||
public void testFunConstructorCallJS() throws Exception {
|
public void testFunConstructorCallJS() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user