[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
|
// FILE: Derived.kt
|
||||||
|
|
||||||
class Derived : Some()
|
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.resolve.toSymbol
|
||||||
import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype
|
import org.jetbrains.kotlin.fir.resolvedTypeFromPrototype
|
||||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
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.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.ConeClassLikeTypeImpl
|
||||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||||
import org.jetbrains.kotlin.fir.types.lowerBoundIfFlexible
|
import org.jetbrains.kotlin.fir.types.lowerBoundIfFlexible
|
||||||
@@ -652,7 +656,7 @@ private fun FirTypeParameter.eraseToUpperBound(
|
|||||||
if (intersectUpperBounds) {
|
if (intersectUpperBounds) {
|
||||||
ConeTypeIntersector.intersectTypes(session.typeContext, symbol.resolvedBounds.map(::eraseAsUpperBound))
|
ConeTypeIntersector.intersectTypes(session.typeContext, symbol.resolvedBounds.map(::eraseAsUpperBound))
|
||||||
} else {
|
} 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
|
// FILE: A.java
|
||||||
public class A<T extends A> {}
|
public class A<T extends A> {}
|
||||||
|
|
||||||
|
|||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
public class A<T extends A> {}
|
public class A<T extends A> {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// (failed) attempt to reproduce exception in
|
// (failed) attempt to reproduce exception in
|
||||||
// http://stackoverflow.com/questions/42571812/unsupportedoperationexception-while-building-a-kotlin-project-in-idea
|
// 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
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
||||||
// FIR_IDENTICAL
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|||||||
Reference in New Issue
Block a user