[FIR] fix resolve contract violation from FirTypeParameter.eraseToUpperBound
^KT-54890
This commit is contained in:
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FILE: Derived.kt
|
||||
|
||||
class Derived : Some()
|
||||
|
||||
@@ -23,9 +23,13 @@ import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
||||
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||
import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassifierSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||
import org.jetbrains.kotlin.fir.types.builder.*
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||
import org.jetbrains.kotlin.fir.types.lowerBoundIfFlexible
|
||||
@@ -652,7 +656,7 @@ private fun FirTypeParameter.eraseToUpperBound(
|
||||
if (intersectUpperBounds) {
|
||||
ConeTypeIntersector.intersectTypes(session.typeContext, symbol.resolvedBounds.map(::eraseAsUpperBound))
|
||||
} else {
|
||||
eraseAsUpperBound(symbol.resolvedBounds.first())
|
||||
eraseAsUpperBound(symbol.fir.bounds.first() as FirResolvedTypeRef)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FILE: A.java
|
||||
public class A<T extends A> {}
|
||||
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FILE: A.java
|
||||
public class A<T extends A> {}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.java
|
||||
import java.util.*;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// (failed) attempt to reproduce exception in
|
||||
// http://stackoverflow.com/questions/42571812/unsupportedoperationexception-while-building-a-kotlin-project-in-idea
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// FILE: A.java
|
||||
|
||||
Reference in New Issue
Block a user