[FIR] Report EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL
^KT-59069 Fixed
This commit is contained in:
committed by
Space Team
parent
f7269eb384
commit
8f4a580c17
+11
-2
@@ -25,8 +25,7 @@ object FirExpectConsistencyChecker : FirBasicDeclarationChecker() {
|
||||
if (
|
||||
declaration !is FirMemberDeclaration ||
|
||||
!isTopLevel && !isInsideClass ||
|
||||
!declaration.isExpect ||
|
||||
declaration is FirConstructor
|
||||
!declaration.isExpect
|
||||
) {
|
||||
return
|
||||
}
|
||||
@@ -34,6 +33,16 @@ object FirExpectConsistencyChecker : FirBasicDeclarationChecker() {
|
||||
val source = declaration.source ?: return
|
||||
if (source.kind is KtFakeSourceElementKind) return
|
||||
|
||||
if (declaration is FirConstructor) {
|
||||
if (!declaration.isPrimary) {
|
||||
val delegatedConstructorSource = declaration.delegatedConstructor?.source
|
||||
if (delegatedConstructorSource?.kind !is KtFakeSourceElementKind) {
|
||||
reporter.reportOn(delegatedConstructorSource, FirErrors.EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL, context)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (Visibilities.isPrivate(declaration.visibility)) {
|
||||
reporter.reportOn(source, FirErrors.EXPECTED_PRIVATE_DECLARATION, context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user