FirTypeResolver. Prohibit resolving FirResolvedTypeRef
This commit is contained in:
+1
-1
@@ -471,7 +471,7 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver() {
|
|||||||
supertypeSupplier: SupertypeSupplier
|
supertypeSupplier: SupertypeSupplier
|
||||||
): Pair<ConeKotlinType, ConeDiagnostic?> {
|
): Pair<ConeKotlinType, ConeDiagnostic?> {
|
||||||
return when (typeRef) {
|
return when (typeRef) {
|
||||||
is FirResolvedTypeRef -> typeRef.type to null
|
is FirResolvedTypeRef -> error("Do not resolve, resolved type-refs")
|
||||||
is FirUserTypeRef -> {
|
is FirUserTypeRef -> {
|
||||||
val (symbol, substitutor, diagnostic) = resolveToSymbol(typeRef, scopeClassDeclaration, useSiteFile, supertypeSupplier)
|
val (symbol, substitutor, diagnostic) = resolveToSymbol(typeRef, scopeClassDeclaration, useSiteFile, supertypeSupplier)
|
||||||
resolveUserType(
|
resolveUserType(
|
||||||
|
|||||||
+1
-1
@@ -401,7 +401,7 @@ open class FirSupertypeResolverVisitor(
|
|||||||
So we create a copy of supertypeRefs to avoid it
|
So we create a copy of supertypeRefs to avoid it
|
||||||
*/
|
*/
|
||||||
supertypeRefs.createCopy().mapTo(mutableListOf()) {
|
supertypeRefs.createCopy().mapTo(mutableListOf()) {
|
||||||
val superTypeRef = transformer.transformTypeRef(it, scopeDeclaration)
|
val superTypeRef = it.transform<FirTypeRef, ScopeClassDeclaration>(transformer, scopeDeclaration)
|
||||||
val typeParameterType = superTypeRef.coneTypeSafe<ConeTypeParameterType>()
|
val typeParameterType = superTypeRef.coneTypeSafe<ConeTypeParameterType>()
|
||||||
when {
|
when {
|
||||||
typeParameterType != null ->
|
typeParameterType != null ->
|
||||||
|
|||||||
Reference in New Issue
Block a user