FIR checker: typed declaration's return type should be resolved
except for those in function contracts
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5f9357eb41
commit
e67eb0c123
+5
-4
@@ -23,6 +23,10 @@ object FirConflictingProjectionChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (declaration is FirTypedDeclaration) {
|
if (declaration is FirTypedDeclaration) {
|
||||||
|
// The body of function contract is not fully resolved.
|
||||||
|
if (declaration.resolvePhase == FirResolvePhase.CONTRACTS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
checkTypeRef(declaration.returnTypeRef, context, reporter)
|
checkTypeRef(declaration.returnTypeRef, context, reporter)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,10 +48,7 @@ object FirConflictingProjectionChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkTypeRef(typeRef: FirTypeRef, context: CheckerContext, reporter: DiagnosticReporter) {
|
private fun checkTypeRef(typeRef: FirTypeRef, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
// TODO: remaining implicit types should be resolved as an error type, along with proper error kind,
|
val declaration = typeRef.coneTypeSafe<ConeClassLikeType>()
|
||||||
// e.g., type mismatch, can't infer parameter type, syntax error, etc.
|
|
||||||
val declaration = typeRef.safeAs<FirResolvedTypeRef>()
|
|
||||||
?.coneTypeSafe<ConeClassLikeType>()
|
|
||||||
?.lookupTag
|
?.lookupTag
|
||||||
?.toSymbol(context.session)
|
?.toSymbol(context.session)
|
||||||
?.fir.safeAs<FirRegularClass>()
|
?.fir.safeAs<FirRegularClass>()
|
||||||
|
|||||||
Reference in New Issue
Block a user