KTIJ-20618 FIR IDE: Enforce resolved type bounds in ConeTypeContext.kt
When lazy resolve is involved, type bounds can be in an unresolved state (e.g. `FirUserTypeRef` instead of `FirResolvedTypeRef`). To enforce the resolve, we use `resolvedTypeBounds` where it might be important ^KTIJ-20618 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
FILE: main.kt
|
||||
public final fun <T> myRun(action: R|() -> T|): R|T| {
|
||||
^myRun R|<local>/action|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
|
||||
}
|
||||
public final fun test(other: R|TypeWithBoundedGeneric<*>|): R|TypeWithBoundedGeneric<*>| {
|
||||
^test R|/myRun|<R|TypeWithBoundedGeneric<*>|>(<L> = myRun@fun <anonymous>(): R|TypeWithBoundedGeneric<*>| <inline=NoInline> {
|
||||
^ R|<local>/other|
|
||||
}
|
||||
)
|
||||
}
|
||||
public abstract interface SomeType : R|kotlin/Any| {
|
||||
}
|
||||
public abstract class TypeWithBoundedGeneric<T : R|SomeType|> : R|kotlin/Any| {
|
||||
public constructor<T : R|SomeType|>(): R|TypeWithBoundedGeneric<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// FILE: main.kt
|
||||
fun <T> myRun(action: () -> T): T = action()
|
||||
|
||||
fun test(other: TypeWithBoundedGeneric<*>) = myRun { other }
|
||||
|
||||
interface SomeType
|
||||
|
||||
abstract class TypeWithBoundedGeneric<T : SomeType>
|
||||
Reference in New Issue
Block a user