[FIR] Report SEALED_CLASS_CONSTRUCTOR_CALL on expression

This commit is contained in:
Andrey Zinovyev
2021-04-14 19:58:53 +03:00
committed by TeamCityServer
parent 48994976d4
commit 088db0e138
3 changed files with 2 additions and 4 deletions
@@ -33,7 +33,7 @@ object FirSealedClassConstructorCallChecker : FirQualifiedAccessChecker() {
?: return
if (typeFir.status.modality == Modality.SEALED) {
reporter.reportOn(expression.calleeReference.source, FirErrors.SEALED_CLASS_CONSTRUCTOR_CALL, context)
reporter.reportOn(expression.source, FirErrors.SEALED_CLASS_CONSTRUCTOR_CALL, context)
}
}
}
@@ -1,3 +0,0 @@
sealed class Base {
fun foo() = <!SEALED_CLASS_CONSTRUCTOR_CALL!>Base<!>()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
sealed class Base {
fun foo() = <!SEALED_CLASS_CONSTRUCTOR_CALL!>Base()<!>
}