[FIR] Fix false positive USELESS_CAST on stub types, ^KT-50293 Fixed

This commit is contained in:
Ivan Kochurkin
2022-06-05 21:53:54 +03:00
committed by teamcity
parent 856d14e5f7
commit fd2b4fd497
17 changed files with 34 additions and 24 deletions
@@ -265,6 +265,7 @@ object BuilderConfigurator : AbstractBuilderConfigurator<FirTreeBuilder>(FirTree
builder(resolvedTypeRef) {
defaultNull("delegatedTypeRef")
default("isFromStubType", "false")
withCopy()
}
@@ -224,7 +224,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
"getter", "setter",
withGetter = true
)
default("returnTypeRef", "FirErrorTypeRefImpl(null, null, diagnostic)")
default("returnTypeRef", "FirErrorTypeRefImpl(null, null, diagnostic, false)")
useTypes(errorTypeRefImplType)
}
@@ -421,13 +421,13 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
}
impl(errorExpression) {
default("typeRef", "FirErrorTypeRefImpl(source, null, ConeStubDiagnostic(diagnostic))")
default("typeRef", "FirErrorTypeRefImpl(source, null, ConeStubDiagnostic(diagnostic), false)")
useTypes(errorTypeRefImplType, coneStubDiagnosticType)
}
impl(errorFunction) {
defaultNull("receiverTypeRef", "body", withGetter = true)
default("returnTypeRef", "FirErrorTypeRefImpl(null, null, diagnostic)")
default("returnTypeRef", "FirErrorTypeRefImpl(null, null, diagnostic, false)")
useTypes(errorTypeRefImplType)
}
@@ -637,6 +637,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
resolvedTypeRef.configure {
+field("type", coneKotlinTypeType)
+field("delegatedTypeRef", typeRef, nullable = true)
+booleanField("isFromStubType")
}
typeRefWithNullability.configure {