diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictingProjectionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictingProjectionChecker.kt index b82cb04fc20..92c716e42ed 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictingProjectionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirConflictingProjectionChecker.kt @@ -23,6 +23,10 @@ object FirConflictingProjectionChecker : FirBasicDeclarationChecker() { } if (declaration is FirTypedDeclaration) { + // The body of function contract is not fully resolved. + if (declaration.resolvePhase == FirResolvePhase.CONTRACTS) { + return + } checkTypeRef(declaration.returnTypeRef, context, reporter) } @@ -44,10 +48,7 @@ object FirConflictingProjectionChecker : FirBasicDeclarationChecker() { } 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, - // e.g., type mismatch, can't infer parameter type, syntax error, etc. - val declaration = typeRef.safeAs() - ?.coneTypeSafe() + val declaration = typeRef.coneTypeSafe() ?.lookupTag ?.toSymbol(context.session) ?.fir.safeAs()