FIR: fix a bunch of issues after DiagnosticsReporter refactoring related to reporting diagnostic on null source
This commit is contained in:
committed by
Space Team
parent
a7edf5b83e
commit
69f2e8826a
+6
-6
@@ -220,6 +220,12 @@ object FirJsExternalChecker : FirBasicDeclarationChecker() {
|
||||
else -> null
|
||||
}
|
||||
|
||||
// we shouldn't check such things as the
|
||||
// copy() function of a data class
|
||||
if (source?.kind !is KtRealSourceElementKind) {
|
||||
return
|
||||
}
|
||||
|
||||
val isWrong = body !is FirSingleExpressionBlock && !hasValidExternalBody()
|
||||
|| initializer != null && !initializer.isDefinedExternallyExpression()
|
||||
|
||||
@@ -229,12 +235,6 @@ object FirJsExternalChecker : FirBasicDeclarationChecker() {
|
||||
reporter.reportOn(initializer.source, FirJsErrors.WRONG_INITIALIZER_OF_EXTERNAL_DECLARATION, context)
|
||||
}
|
||||
|
||||
// we shouldn't check such things as the
|
||||
// copy() function of a data class
|
||||
if (source?.kind !is KtRealSourceElementKind) {
|
||||
return
|
||||
}
|
||||
|
||||
if (this is FirFunction) {
|
||||
for (defaultValue in valueParameters.mapNotNull { it.defaultValue }) {
|
||||
if (!defaultValue.isDefinedExternallyExpression()) {
|
||||
|
||||
Reference in New Issue
Block a user