FIR: introduce VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION check
Besides adding VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION, we remove here NO_TYPE_FOR_TYPE_PARAMETER since it doesn't exist in FE1.0. The name also doesn't make much sense. From the usage it looks like it should have been VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION instead.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
f4b840467f
commit
94de193993
@@ -53,7 +53,7 @@ fun FirFunction<*>.constructFunctionalTypeRef(isSuspend: Boolean = false): FirRe
|
||||
it.returnTypeRef.coneTypeSafe<ConeKotlinType>() ?: ConeKotlinErrorType(
|
||||
ConeSimpleDiagnostic(
|
||||
"No type for parameter",
|
||||
DiagnosticKind.NoTypeForTypeParameter
|
||||
DiagnosticKind.ValueParameterWithNoTypeAnnotation
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+4
-2
@@ -578,7 +578,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
||||
if (valueParameter.returnTypeRef is FirImplicitTypeRef) {
|
||||
transformer.replaceDeclarationResolvePhaseIfNeeded(valueParameter, transformerPhase)
|
||||
valueParameter.replaceReturnTypeRef(
|
||||
valueParameter.returnTypeRef.errorTypeFromPrototype(ConeSimpleDiagnostic("Unresolved value parameter type"))
|
||||
valueParameter.returnTypeRef.errorTypeFromPrototype(
|
||||
ConeSimpleDiagnostic("No type for parameter", DiagnosticKind.ValueParameterWithNoTypeAnnotation)
|
||||
)
|
||||
)
|
||||
return context.withValueParameter(valueParameter) {
|
||||
valueParameter.compose()
|
||||
@@ -833,7 +835,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
||||
valueParameter.transformReturnTypeRef(
|
||||
StoreType,
|
||||
valueParameter.returnTypeRef.resolvedTypeFromPrototype(
|
||||
ConeKotlinErrorType(ConeSimpleDiagnostic("No type for parameter", DiagnosticKind.NoTypeForTypeParameter))
|
||||
ConeKotlinErrorType(ConeSimpleDiagnostic("No type for parameter", DiagnosticKind.ValueParameterWithNoTypeAnnotation))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user