FirTypeResolver. Prohibit resolving FirResolvedTypeRef

This commit is contained in:
Simon Ogorodnik
2022-02-11 23:05:42 +03:00
committed by Space
parent bf3a3caee6
commit 2a7aa2f240
2 changed files with 2 additions and 2 deletions
@@ -471,7 +471,7 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
supertypeSupplier: SupertypeSupplier
): Pair<ConeKotlinType, ConeDiagnostic?> {
return when (typeRef) {
is FirResolvedTypeRef -> typeRef.type to null
is FirResolvedTypeRef -> error("Do not resolve, resolved type-refs")
is FirUserTypeRef -> {
val (symbol, substitutor, diagnostic) = resolveToSymbol(typeRef, scopeClassDeclaration, useSiteFile, supertypeSupplier)
resolveUserType(
@@ -401,7 +401,7 @@ open class FirSupertypeResolverVisitor(
So we create a copy of supertypeRefs to avoid it
*/
supertypeRefs.createCopy().mapTo(mutableListOf()) {
val superTypeRef = transformer.transformTypeRef(it, scopeDeclaration)
val superTypeRef = it.transform<FirTypeRef, ScopeClassDeclaration>(transformer, scopeDeclaration)
val typeParameterType = superTypeRef.coneTypeSafe<ConeTypeParameterType>()
when {
typeParameterType != null ->