FIR call completion: approximate type argument types
This commit removes some captured / ILT types at the end of resolve
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ FILE: typeAliasWithNotNullBound.kt
|
||||
}
|
||||
public final typealias MyAlias = R|Inv<out kotlin/CharSequence>|
|
||||
public final fun foo(p: R|MyAlias|): R|kotlin/Unit| {
|
||||
R|/bar|<R|CapturedType(out kotlin/CharSequence)|>(R|<local>/p|).R|kotlin/CharSequence.length|
|
||||
R|/bar|<R|kotlin/CharSequence|>(R|<local>/p|).R|kotlin/CharSequence.length|
|
||||
}
|
||||
public final fun <T : R|kotlin/Any|> bar(x: R|Inv<T>|): R|T| {
|
||||
^bar R|kotlin/TODO|()
|
||||
|
||||
Vendored
+1
-1
@@ -4,5 +4,5 @@ FILE: main.kt
|
||||
public final fun <D : R|A|> foo(b: R|B<D>|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun main(b: R|B<*>|): R|kotlin/Unit| {
|
||||
R|/foo|<R|CapturedType(*)|>(R|<local>/b|)
|
||||
R|/foo|<R|ft<A, A?>!|>(R|<local>/b|)
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,5 +7,5 @@ FILE: main.kt
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|/K.K|<R|kotlin/Int|>(Int(0))
|
||||
R|/JavaClass.JavaClass|<R|ft<ILT: 0, ILT: 0?>!|>(Int(0))
|
||||
R|/JavaClass.JavaClass|<R|ft<kotlin/Int, kotlin/Int?>!|>(Int(0))
|
||||
}
|
||||
|
||||
+4
-4
@@ -15,19 +15,19 @@ FILE: receiverWithCapturedType.kt
|
||||
^updateD R|<local>/d|
|
||||
}
|
||||
public final fun test_1_1(resolvedCall: R|ResolvedCall<out CallableDescriptor>|): R|kotlin/Unit| {
|
||||
R|<local>/resolvedCall|.R|/getParameterForArgument|<R|CapturedType(out CallableDescriptor)|>()
|
||||
R|<local>/resolvedCall|.R|/getParameterForArgument|<R|CallableDescriptor|>()
|
||||
}
|
||||
public final fun test_1_2(resolvedCall: R|ResolvedCall<in CallableDescriptor>|): R|kotlin/Unit| {
|
||||
R|<local>/resolvedCall|.R|/getParameterForArgument|<R|CapturedType(in CallableDescriptor)|>()
|
||||
R|<local>/resolvedCall|.R|/getParameterForArgument|<R|CallableDescriptor|>()
|
||||
}
|
||||
public final fun test_1_3(resolvedCall: R|ResolvedCall<CallableDescriptor>|): R|kotlin/Unit| {
|
||||
R|<local>/resolvedCall|.R|/getParameterForArgument|<R|CallableDescriptor|>()
|
||||
}
|
||||
public final fun test_2_1(resolvedCall: R|ResolvedCall<out CallableDescriptor>|, d: R|CallableDescriptor|): R|kotlin/Unit| {
|
||||
lval x: R|CallableDescriptor| = R|<local>/resolvedCall|.<Inapplicable(INAPPLICABLE): /updateD>#<R|CapturedType(out CallableDescriptor)|>(R|<local>/d|)
|
||||
lval x: R|CallableDescriptor| = R|<local>/resolvedCall|.<Inapplicable(INAPPLICABLE): /updateD>#<R|CallableDescriptor|>(R|<local>/d|)
|
||||
}
|
||||
public final fun test_2_2(resolvedCall: R|ResolvedCall<in CallableDescriptor>|, d: R|CallableDescriptor|): R|kotlin/Unit| {
|
||||
lval x: R|CallableDescriptor| = R|<local>/resolvedCall|.R|/updateD|<R|CapturedType(in CallableDescriptor)|>(R|<local>/d|)
|
||||
lval x: R|CallableDescriptor| = R|<local>/resolvedCall|.R|/updateD|<R|CallableDescriptor|>(R|<local>/d|)
|
||||
}
|
||||
public final fun test_2_3(resolvedCall: R|ResolvedCall<CallableDescriptor>|, d: R|CallableDescriptor|): R|kotlin/Unit| {
|
||||
lval x: R|CallableDescriptor| = R|<local>/resolvedCall|.R|/updateD|<R|CallableDescriptor|>(R|<local>/d|)
|
||||
|
||||
+6
-6
@@ -19,10 +19,10 @@ FILE: simpleCapturedTypes.kt
|
||||
^ this@R|/idP|
|
||||
}
|
||||
private final fun getSetterInfos(kc: R|KC<out Ann>|): R|kotlin/Unit| {
|
||||
R|/id|<R|CapturedType(out Ann)|>(R|<local>/kc|).R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
R|<local>/kc|.R|/idR|<R|CapturedType(out Ann)|>().R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
R|<local>/kc|.R|/idP|<R|CapturedType(out Ann)|>.R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
lval x1: R|KC<out Ann>| = R|/id|<R|CapturedType(out Ann)|>(R|<local>/kc|)
|
||||
lval x2: R|KC<out Ann>| = R|<local>/kc|.R|/idR|<R|CapturedType(out Ann)|>()
|
||||
lval x3: R|KC<out Ann>| = R|<local>/kc|.R|/idP|<R|CapturedType(out Ann)|>
|
||||
R|/id|<R|Ann|>(R|<local>/kc|).R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
R|<local>/kc|.R|/idR|<R|Ann|>().R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
R|<local>/kc|.R|/idP|<R|Ann|>.R|FakeOverride</KC.x: R|Ann|>|.R|/Ann.foo|()
|
||||
lval x1: R|KC<out Ann>| = R|/id|<R|Ann|>(R|<local>/kc|)
|
||||
lval x2: R|KC<out Ann>| = R|<local>/kc|.R|/idR|<R|Ann|>()
|
||||
lval x3: R|KC<out Ann>| = R|<local>/kc|.R|/idP|<R|Ann|>
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FILE: capturedFlexible.kt
|
||||
public final fun foo(z: R|java/util/zip/ZipFile|): R|kotlin/Unit| {
|
||||
R|<local>/z|.R|java/util/zip/ZipFile.entries|().R|kotlin/sequences/asSequence|<R|CapturedType(out ft<java/util/zip/ZipEntry, java/util/zip/ZipEntry?>!)|>()
|
||||
R|<local>/z|.R|java/util/zip/ZipFile.entries|().R|kotlin/sequences/asSequence|<R|ft<java/util/zip/ZipEntry, java/util/zip/ZipEntry?>!|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ FILE: withInInitializer.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val list: R|kotlin/collections/List<it(kotlin/Comparable<*> & java/io/Serializable)>| = R|kotlin/collections/listOf|<R|it(kotlin/Comparable<it(kotlin/String & kotlin/Int)> & java/io/Serializable)|>(vararg(Int(1), Int(2), Int(3), String()))
|
||||
public final val list: R|kotlin/collections/List<it(kotlin/Comparable<*> & java/io/Serializable)>| = R|kotlin/collections/listOf|<R|it(kotlin/Comparable<*> & java/io/Serializable)|>(vararg(Int(1), Int(2), Int(3), String()))
|
||||
public get(): R|kotlin/collections/List<it(kotlin/Comparable<*> & java/io/Serializable)>|
|
||||
|
||||
public final val data: R|First| = R|/First.First|(Int(42))
|
||||
|
||||
+7
-1
@@ -424,7 +424,13 @@ class FirCallCompletionResultsWriterTransformer(
|
||||
|
||||
return declaration.typeParameters.map { ConeTypeParameterTypeImpl(it.symbol.toLookupTag(), false) }
|
||||
.map { candidate.substitutor.substituteOrSelf(it) }
|
||||
.map { finalSubstitutor.substituteOrSelf(it) }
|
||||
.map {
|
||||
finalSubstitutor.substituteOrSelf(it).let { substitutedType ->
|
||||
typeApproximator.approximateToSuperType(
|
||||
substitutedType, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference,
|
||||
) as ConeKotlinType? ?: substitutedType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun transformAnonymousFunction(
|
||||
|
||||
@@ -154,7 +154,7 @@ FILE fqName:<root> fileName:/ClashResolutionDescriptor.kt
|
||||
TYPE_OP type=kotlin.collections.Collection<<root>.ComponentDescriptor>? origin=SAFE_CAST typeOperand=kotlin.collections.Collection<<root>.ComponentDescriptor>
|
||||
CALL 'public open fun get (p0: kotlin.Any?): V of java.util.HashMap? [operator] declared in java.util.HashMap' type=kotlin.Any? origin=null
|
||||
$this: CALL 'private final fun <get-registrationMap> (): java.util.HashMap<java.lang.reflect.Type, kotlin.Any> declared in <root>' type=java.util.HashMap<java.lang.reflect.Type, kotlin.Any> origin=GET_PROPERTY
|
||||
p0: CALL 'public final fun <get-applicableTo> (): java.lang.Class<E of <root>.PlatformExtensionsClashResolver> declared in <root>.PlatformExtensionsClashResolver' type=java.lang.Class<<root>.PlatformSpecificExtension<E of <root>.PlatformExtensionsClashResolver>> origin=GET_PROPERTY
|
||||
p0: CALL 'public final fun <get-applicableTo> (): java.lang.Class<E of <root>.PlatformExtensionsClashResolver> declared in <root>.PlatformExtensionsClashResolver' type=java.lang.Class<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>> origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val resolver: <root>.PlatformExtensionsClashResolver<*> [val] declared in <root>.resolveClashesIfAny' type=<root>.PlatformExtensionsClashResolver<*> origin=null
|
||||
WHEN type=kotlin.collections.Collection<<root>.ComponentDescriptor> origin=ELVIS
|
||||
BRANCH
|
||||
@@ -166,9 +166,9 @@ FILE fqName:<root> fileName:/ClashResolutionDescriptor.kt
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: TYPE_OP type=kotlin.collections.Collection<<root>.ComponentDescriptor> origin=IMPLICIT_CAST typeOperand=kotlin.collections.Collection<<root>.ComponentDescriptor>
|
||||
GET_VAR 'val tmp_1: kotlin.collections.Collection<<root>.ComponentDescriptor>? [val] declared in <root>.resolveClashesIfAny' type=kotlin.collections.Collection<<root>.ComponentDescriptor>? origin=null
|
||||
VAR name:substituteDescriptor type:<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<E of <root>.PlatformExtensionsClashResolver>> [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (container: <root>.ComponentContainer, resolver: <root>.PlatformExtensionsClashResolver<E of <root>.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<<root>.ComponentDescriptor>) [primary] declared in <root>.ClashResolutionDescriptor' type=<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<E of <root>.PlatformExtensionsClashResolver>> origin=null
|
||||
<class: E>: <root>.PlatformSpecificExtension<E of <root>.PlatformExtensionsClashResolver>
|
||||
VAR name:substituteDescriptor type:<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>> [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (container: <root>.ComponentContainer, resolver: <root>.PlatformExtensionsClashResolver<E of <root>.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<<root>.ComponentDescriptor>) [primary] declared in <root>.ClashResolutionDescriptor' type=<root>.ClashResolutionDescriptor<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>> origin=null
|
||||
<class: E>: <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out <root>.PlatformSpecificExtension<out kotlin.Any?>>>>>
|
||||
container: GET_VAR 'container: <root>.ComponentContainer declared in <root>.resolveClashesIfAny' type=<root>.ComponentContainer origin=null
|
||||
resolver: GET_VAR 'val resolver: <root>.PlatformExtensionsClashResolver<*> [val] declared in <root>.resolveClashesIfAny' type=<root>.PlatformExtensionsClashResolver<*> origin=null
|
||||
clashedComponents: CALL 'public final fun toList <T> (): kotlin.collections.List<T of kotlin.collections.toList> declared in kotlin.collections' type=kotlin.collections.List<<root>.ComponentDescriptor> origin=null
|
||||
|
||||
Reference in New Issue
Block a user