K2: repeat K1 representation for flexible type parameters
This commit changes the behavior of KT-59138 effectively declining it in 2.0. However, we plan to implement KT-59138 behavior under a feature flag in 2.0 (see KT-66447), and switch this feature on version 2.x. Also, this commit implements the LC resolution about postponing KT-57014 change. We don't have KT-57014 described behavior in 2.0 anymore. However, we plan to implement a deprecation warning here, see KT-65578. After this commit, 6 diagnostic tests become incorrectly broken: - 5 tests from PurelyImplementedCollection group - a test platformTypes/nullableTypeArgument.kt This commit also breaks currently fixed-in-k2 KT-50134 (it is fixed again in the following commits), as well as KT-58933 (it will remain not fixed till we enable KT-59138 behavior again). #KT-65596 In Progress #KT-57014 In Progress #KT-58933 Submitted
This commit is contained in:
committed by
Space Team
parent
7fd46f1450
commit
81414d758d
+1
-1
@@ -7,7 +7,7 @@ FILE: main.kt
|
||||
public abstract interface PsiClass : R|kotlin/Any| {
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval processor: R|AdapterProcessor<PsiMethod, PsiClass>| = R|/AdapterProcessor.AdapterProcessor|<R|PsiMethod|, R|PsiClass|>(R|/Function|<R|PsiMethod!|, R|PsiClass!|>(<L> = Function@fun <anonymous>(method: R|PsiMethod?|): R|PsiClass!| <inline=NoInline> {
|
||||
lval processor: R|AdapterProcessor<PsiMethod!, PsiClass!>| = R|/AdapterProcessor.AdapterProcessor|<R|PsiMethod!|, R|PsiClass!|>(R|/Function|<R|PsiMethod!|, R|PsiClass?|>(<L> = Function@fun <anonymous>(method: R|PsiMethod?|): R|PsiClass?| <inline=NoInline> {
|
||||
^ R|<local>/method|?.{ $subj$.R|/PsiMethod.containingClass| }
|
||||
}
|
||||
))
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
FILE: main.kt
|
||||
public final fun <T> test(executor: R|BuildActionExecuter<T>|, modelType: R|java/lang/Class<T>|, env: R|kotlin/collections/Map<kotlin/String, kotlin/String>|): R|kotlin/Unit| {
|
||||
lval model: R|ft<BuildActionExecuter<ft<T & Any, T?>>, BuildActionExecuter<ft<T & Any, T?>>?>| = R|<local>/executor|.R|SubstitutionOverride</BuildActionExecuter.setEnvironmentVariables: R|ft<BuildActionExecuter<ft<T & Any, T?>>, BuildActionExecuter<ft<T & Any, T?>>?>|>|(R|<local>/env|)
|
||||
lval model: R|ft<BuildActionExecuter<T!>, BuildActionExecuter<T!>?>| = R|<local>/executor|.R|SubstitutionOverride</BuildActionExecuter.setEnvironmentVariables: R|ft<BuildActionExecuter<T!>, BuildActionExecuter<T!>?>|>|(R|<local>/env|)
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,13 +26,13 @@ FILE: main.kt
|
||||
|
||||
}
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
lval map: R|util/HashMap<kotlin/Int, kotlin/Int>| = R|util/HashMap.HashMap|<R|kotlin/Int|, R|kotlin/Int|>()
|
||||
lval map: R|util/HashMap<kotlin/Int!, kotlin/Int!>| = R|util/HashMap.HashMap|<R|kotlin/Int!|, R|kotlin/Int!|>()
|
||||
}
|
||||
public final fun test_2(): R|kotlin/Unit| {
|
||||
lval set: R|util/HashSet<kotlin/Int>| = R|util/HashSet.HashSet|<R|kotlin/Int|>()
|
||||
}
|
||||
public final fun test_3(): R|kotlin/Unit| {
|
||||
lval list: R|foo/ArrayList<kotlin/Int>| = R|foo/ArrayList.ArrayList|<R|kotlin/Int|>()
|
||||
lval list: R|foo/ArrayList<kotlin/Int!>| = R|foo/ArrayList.ArrayList|<R|kotlin/Int!|>()
|
||||
}
|
||||
public final fun test_4(): R|kotlin/Unit| {
|
||||
lval list: R|foo/LinkedList<kotlin/Int>| = R|foo/LinkedList.LinkedList|<R|kotlin/Int|>()
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ FILE: test.kt
|
||||
lval element: R|DE| = R|<local>/d|.R|/Diagnostic.element|
|
||||
R|/Fix.Fix|(R|<local>/element|)
|
||||
}
|
||||
private final val DERIVED_FACTORY: R|DiagnosticFactory0<DerivedElement>| = R|/DiagnosticFactory0.DiagnosticFactory0|<R|DerivedElement|>()
|
||||
private get(): R|DiagnosticFactory0<DerivedElement>|
|
||||
private final val DERIVED_FACTORY: R|DiagnosticFactory0<DerivedElement!>| = R|/DiagnosticFactory0.DiagnosticFactory0|<R|DerivedElement!|>()
|
||||
private get(): R|DiagnosticFactory0<DerivedElement!>|
|
||||
public final fun createViaFactory(d: R|EmptyDiagnostic|): R|kotlin/Unit| {
|
||||
lval casted: R|Diagnostic<DerivedElement!>| = R|/DERIVED_FACTORY|.R|SubstitutionOverride</DiagnosticFactory0.cast: R|@EnhancedNullability Diagnostic<DerivedElement!>|>|(R|<local>/d|)
|
||||
lval element: R|DerivedElement| = R|<local>/casted|.R|/Diagnostic.element|
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FILE: flexibleTypeBug.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lvar list1: R|ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>| = Q|java/util/Collections|.R|java/util/Collections.emptyList*s|<R|kotlin/String|>()
|
||||
lvar list1: R|ft<kotlin/collections/MutableList<kotlin/String!>, kotlin/collections/List<kotlin/String!>?>| = Q|java/util/Collections|.R|java/util/Collections.emptyList*s|<R|kotlin/String!|>()
|
||||
lval list2: R|kotlin/collections/List<kotlin/String>| = R|kotlin/collections/listOf|<R|kotlin/String|>(String(b))
|
||||
R|<local>/list1| = R|<local>/list1|.R|kotlin/collections/plus|<R|kotlin/String!|>(R|<local>/list2|)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
FILE: javaCollector.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
R|kotlin/collections/listOf|<R|kotlin/String|>(String()).R|SubstitutionOverride<kotlin/collections/List.stream: R|@EnhancedNullability java/util/stream/Stream<@EnhancedNullability kotlin/String>|>|().R|SubstitutionOverride<java/util/stream/Stream.collect: R|ft<R & Any, R?>|>|<R|ft<kotlin/collections/MutableMap<kotlin/String!, kotlin/Int!>, kotlin/collections/Map<kotlin/String!, kotlin/Int!>?>|, R|ft<CapturedType(*), CapturedType(*)?>|>(Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.groupingBy*s|<R|kotlin/String!|, R|kotlin/String!|, R|ft<CapturedType(*), CapturedType(*)?>|, R|kotlin/Int!|>(SAM(groupingBy@fun <anonymous>(it: R|@EnhancedNullability kotlin/String!|): R|@EnhancedNullability kotlin/String!| <inline=NoInline> {
|
||||
R|kotlin/collections/listOf|<R|kotlin/String|>(String()).R|SubstitutionOverride<kotlin/collections/List.stream: R|@EnhancedNullability java/util/stream/Stream<@EnhancedNullability kotlin/String>|>|().R|SubstitutionOverride<java/util/stream/Stream.collect: R|R!|><Inapplicable(INAPPLICABLE): java/util/stream/Stream.collect>#|<<ERROR TYPE REF: Cannot infer argument for type parameter R>, <ERROR TYPE REF: Cannot infer argument for type parameter A>>(Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.groupingBy*s<CS errors: java/util/stream/Collectors.groupingBy>#|<R|kotlin/String!|, <ERROR TYPE REF: Cannot infer argument for type parameter K>, R|kotlin/Any!|, R|kotlin/Int!|>(SAM(groupingBy@fun <anonymous>(it: R|@EnhancedNullability kotlin/String!|): <ERROR TYPE REF: Cannot infer argument for type parameter K> <inline=NoInline> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
), Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.collectingAndThen*s|<R|kotlin/String!|, R|ft<CapturedType(*), CapturedType(*)?>|, R|kotlin/Long!|, R|kotlin/Int!|>(Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.counting*s|<R|kotlin/String|>(), SAM(Q|kotlin/Long|::R|kotlin/Long.toInt|))))
|
||||
), Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.collectingAndThen*s|<R|kotlin/String!|, R|ft<CapturedType(*), CapturedType(*)?>|, R|kotlin/Long!|, R|kotlin/Int!|>(Q|java/util/stream/Collectors|.R|java/util/stream/Collectors.counting*s|<R|kotlin/String!|>(), SAM(Q|kotlin/Long|::R|kotlin/Long.toInt|))))
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import java.util.stream.Collectors
|
||||
|
||||
fun foo(){
|
||||
listOf("").stream().collect(
|
||||
Collectors.groupingBy(
|
||||
<!ARGUMENT_TYPE_MISMATCH, NEW_INFERENCE_ERROR!>Collectors.groupingBy(
|
||||
{ it },
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.counting<String>(),
|
||||
Long::toInt
|
||||
)
|
||||
)
|
||||
)<!>
|
||||
)
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,9 +41,9 @@ FILE: onlyInputTypesCapturedTypeWithRecursiveBounds.kt
|
||||
|
||||
}
|
||||
private final fun test(node: R|FooEnumMap<*>|): R|kotlin/Unit| {
|
||||
R|<local>/node|.R|SubstitutionOverride</FooEnumMap.data: R|java/util/EnumMap<CapturedType(*), kotlin/Any?>|>|.R|kotlin/collections/get|<R|ft<it(kotlin/Enum<*> & I), it(kotlin/Enum<*>? & I?)>|, R|kotlin/Any!|>(Q|MyEnum|.R|/MyEnum.EnumEntry|)
|
||||
R|<local>/node|.R|SubstitutionOverride</FooEnumMap.data: R|java/util/EnumMap<CapturedType(*), kotlin/Any?>|>|.R|kotlin/collections/get|<R|ft<it(kotlin/Enum<*> & I), it(kotlin/Enum<*>? & I?)>|, R|kotlin/Any?|>(Q|MyEnum|.R|/MyEnum.EnumEntry|)
|
||||
lval map: R|java/util/EnumMap<out it(kotlin/Enum<*> & I), kotlin/Any?>| = R|<local>/node|.R|SubstitutionOverride</FooEnumMap.data: R|java/util/EnumMap<CapturedType(*), kotlin/Any?>|>|
|
||||
R|<local>/map|.R|kotlin/collections/get|<R|ft<it(kotlin/Enum<out ft<it(kotlin/Enum<out ft<it(kotlin/Enum<*> & I), it(kotlin/Enum<*>? & I?)>> & I), it(kotlin/Enum<*>? & I?)>> & I), it(kotlin/Enum<*>? & I?)>|, R|kotlin/Any!|>(Q|MyEnum|.R|/MyEnum.EnumEntry|)
|
||||
R|<local>/map|.R|kotlin/collections/get|<R|ft<it(kotlin/Enum<*> & I), it(kotlin/Enum<*>? & I?)>|, R|kotlin/Any?|>(Q|MyEnum|.R|/MyEnum.EnumEntry|)
|
||||
}
|
||||
public open class Foo2<P : R|I|> : R|kotlin/Any| {
|
||||
public constructor<P : R|I|>(data: R|kotlin/collections/Map<P, kotlin/Any?>|): R|Foo2<P>| {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FILE: main.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lval a: R|ft<Java<*, kotlin/String!>, Java<*, kotlin/String!>?>| = Q|Java|.R|/Java.factory*s|<R|kotlin/String!|>(String())
|
||||
lval b: R|ft<Java<*, kotlin/String!>, Java<*, kotlin/String!>?>| = R|<local>/a|.R|SubstitutionOverride</Java.produceSelf: R|ft<CapturedType(*) & Any, CapturedType(*)?>|>|()
|
||||
lval b: R|ft<Java<*, kotlin/String!>, Java<*, kotlin/String!>?>| = R|<local>/a|.R|SubstitutionOverride</Java.produceSelf: R|ft<CapturedType(*), CapturedType(*)?>|>|()
|
||||
R|<local>/b|.R|SubstitutionOverride</Java.consumeElement: R|kotlin/Unit|>|(String(testing))
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FILE: main.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|/JavaClass.JavaClass|<R|kotlin/String|>(Null(null)).R|SubstitutionOverride</JavaClass.foo: R|kotlin/String!|>|().R|kotlin/String.length|
|
||||
R|/JavaClass.JavaClass|<R|kotlin/String!|>(Null(null)).R|SubstitutionOverride</JavaClass.foo: R|kotlin/String!|>|().R|kotlin/String.length|
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FILE: main.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|/MyFunction|<R|kotlin/Int|, R|kotlin/String|>(<L> = MyFunction@fun <anonymous>(x: R|kotlin/Int!|): R|kotlin/String!| <inline=NoInline> {
|
||||
R|/MyFunction|<R|kotlin/Int!|, R|kotlin/String!|>(<L> = MyFunction@fun <anonymous>(x: R|kotlin/Int!|): R|kotlin/String!| <inline=NoInline> {
|
||||
^ R|<local>/x|.R|kotlin/Int.toInt|().R|kotlin/Int.toString|()
|
||||
}
|
||||
)
|
||||
|
||||
Vendored
+4
-4
@@ -3,8 +3,8 @@ C:
|
||||
[Enhancement]: public abstract fun getName(): R|kotlin/String!| from Substitution scope for [Java enhancement scope for /B] for type C [id: 1]
|
||||
[Enhancement]: public abstract fun getName(): R|kotlin/String!| from Java enhancement scope for /A [id: 1]
|
||||
[Source]: public open override fun setName(newName: R|kotlin/String|): R|kotlin/Any?| from Use site scope of /C [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun setName(newName: R|kotlin/String!|): R|kotlin/Any!| from Substitution scope for [Java enhancement scope for /B] for type C [id: 1]
|
||||
[Enhancement]: public abstract fun setName(newName: R|kotlin/String!|): R|ft<T & Any, T?>| from Java enhancement scope for /B [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun setName(newName: R|kotlin/String!|): R|kotlin/Any?| from Substitution scope for [Java enhancement scope for /B] for type C [id: 1]
|
||||
[Enhancement]: public abstract fun setName(newName: R|kotlin/String!|): R|T!| from Java enhancement scope for /B [id: 2]
|
||||
[Source]: private final var name: R|kotlin/String| from Use site scope of /C [id: 0]
|
||||
|
||||
D:
|
||||
@@ -14,8 +14,8 @@ D:
|
||||
[Enhancement]: public abstract fun getName(): R|kotlin/String!| from Java enhancement scope for /A [id: 1]
|
||||
[Source]: public open override fun setName(newName: R|kotlin/String|): R|kotlin/Any?| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public open override fun setName(newName: R|kotlin/String|): R|kotlin/Any?| from Use site scope of /C [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun setName(newName: R|kotlin/String!|): R|kotlin/Any!| from Substitution scope for [Java enhancement scope for /B] for type C [id: 1]
|
||||
[Enhancement]: public abstract fun setName(newName: R|kotlin/String!|): R|ft<T & Any, T?>| from Java enhancement scope for /B [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun setName(newName: R|kotlin/String!|): R|kotlin/Any?| from Substitution scope for [Java enhancement scope for /B] for type C [id: 1]
|
||||
[Enhancement]: public abstract fun setName(newName: R|kotlin/String!|): R|T!| from Java enhancement scope for /B [id: 2]
|
||||
[Source]: private final var name: R|kotlin/String| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: private final var name: R|kotlin/String| from Use site scope of /C [id: 0]
|
||||
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
SomeMap:
|
||||
[Enhancement]: public abstract fun containsKey(key: R|ft<K3 & Any, K3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|ft<K3 & Any, K3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[Enhancement]: public abstract fun containsKey(key: R|K3!|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|K3!|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|K|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|K|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
|
||||
[Library]: public abstract fun containsKey(key: R|K|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
|
||||
@@ -8,25 +8,25 @@ SomeMap:
|
||||
[Enhancement]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 5]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyBaseMap] for type MyMap<K2, V2> [id: 6]
|
||||
[Enhancement]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyBaseMap [id: 7]
|
||||
[IntersectionOverride]: public abstract override fun containsValue(value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsValue(value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[IntersectionOverride]: public abstract override fun containsValue(value: R|V3!|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsValue(value: R|V3!|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsValue(value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsValue(value: R|V|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
|
||||
[Library]: public abstract fun containsValue(value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/Map [id: 3]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsValue(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
|
||||
[Enhancement]: public abstract fun containsValue(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 5]
|
||||
[IntersectionOverride]: public abstract override operator fun get(key: R|ft<K3 & Any, K3?>|): R|V3?| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|ft<K3 & Any, K3?>|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[IntersectionOverride]: public abstract override operator fun get(key: R|K3!|): R|V3?| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|K3!|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|K|): R|V?| from Use site scope of kotlin/collections/MutableMap [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|K|): R|V?| from Substitution scope for [Use site scope of kotlin/collections/Map] for type kotlin/collections/MutableMap<K, V> [id: 2]
|
||||
[Library]: public abstract operator fun get(key: R|K|): R|V?| from Use site scope of kotlin/collections/Map [id: 3]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|ft<K3 & Any, K3?>|): R|ft<V3 & Any, V3?>| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
|
||||
[Enhancement]: public abstract operator fun get(key: R|ft<K2 & Any, K2?>|): R|ft<V2 & Any, V2?>| from Java enhancement scope for /MyMap [id: 5]
|
||||
[Enhancement]: public abstract fun remove(key: R|ft<K3 & Any, K3?>|): R|@EnhancedNullability V3?| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(key: R|ft<K3 & Any, K3?>|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override operator fun get(key: R|K3!|): R|V3!| from Substitution scope for [Java enhancement scope for /MyMap] for type SomeMap<K3, V3> [id: 4]
|
||||
[Enhancement]: public abstract operator fun get(key: R|K2!|): R|V2!| from Java enhancement scope for /MyMap [id: 5]
|
||||
[Enhancement]: public abstract fun remove(key: R|K3!|): R|@EnhancedNullability V3?| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun remove(key: R|K3!|): R|V3?| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 1]
|
||||
[Library]: public abstract fun remove(key: R|K|): R|V?| from Use site scope of kotlin/collections/MutableMap [id: 2]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun remove(key: R|ft<K3 & Any, K3?>|, value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun remove(key: R|ft<K3 & Any, K3?>|, value: R|ft<V3 & Any, V3?>|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun remove(key: R|K3!|, value: R|V3!|): R|kotlin/Boolean| from Java enhancement scope for /SomeMap [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun remove(key: R|K3!|, value: R|V3!|): R|kotlin/Boolean| from Substitution scope for [Use site scope of kotlin/collections/MutableMap] for type SomeMap<K3, V3> [id: 0]
|
||||
[Library]: public open fun remove(key: R|K|, value: R|V|): R|kotlin/Boolean| from Use site scope of kotlin/collections/MutableMap [id: 1]
|
||||
|
||||
MyMap:
|
||||
@@ -34,5 +34,5 @@ MyMap:
|
||||
[SubstitutionOverride(DeclarationSite)]: public abstract override fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Substitution scope for [Java enhancement scope for /MyBaseMap] for type MyMap<K2, V2> [id: 1]
|
||||
[Enhancement]: public abstract fun containsKey(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyBaseMap [id: 2]
|
||||
[Enhancement]: public abstract fun containsValue(key: R|kotlin/Any!|): R|kotlin/Boolean| from Java enhancement scope for /MyMap [id: 0]
|
||||
[Enhancement]: public abstract operator fun get(key: R|ft<K2 & Any, K2?>|): R|ft<V2 & Any, V2?>| from Java enhancement scope for /MyMap [id: 0]
|
||||
[Enhancement]: public abstract operator fun get(key: R|K2!|): R|V2!| from Java enhancement scope for /MyMap [id: 0]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: main.kt
|
||||
public final fun <T : R|kotlin/CharSequence?|> foo(mapper: R|Mapper|, cls: R|java/lang/Class<T>?|): R|kotlin/Unit| {
|
||||
lval result: R|T & Any| = R|<local>/mapper|.R|/Mapper.readValue|<R|T|>(R|<local>/cls|)!!
|
||||
lval result: R|T & Any| = R|<local>/mapper|.R|/Mapper.readValue|<R|T!|>(R|<local>/cls|)!!
|
||||
R|<local>/result|.R|kotlin/CharSequence.length|
|
||||
}
|
||||
|
||||
compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/smartcastToStarProjectedSubclass.kt
Vendored
+1
-1
@@ -15,7 +15,7 @@ public interface Option<T> {
|
||||
// FILE: test.kt
|
||||
fun test_1(option: Option<Pair<String, String>>?) {
|
||||
if (option is Option.Some<*>) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(*)!! & kotlin.Pair<kotlin.String, kotlin.String>..CapturedType(*)? & kotlin.Pair<kotlin.String, kotlin.String>?")!>option.get()<!>.first
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(*) & kotlin.Pair<kotlin.String, kotlin.String>..CapturedType(*)? & kotlin.Pair<kotlin.String, kotlin.String>?")!>option.get()<!>.first
|
||||
x.length
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
FILE: main.kt
|
||||
private final val anyProperty: R|Property<kotlin/Any>| = R|/Property.Property|<R|kotlin/Any|>()
|
||||
private get(): R|Property<kotlin/Any>|
|
||||
private final val boundedProperty: R|Property<kotlin/String>| = R|/Property.Property|<R|kotlin/String|>()
|
||||
private get(): R|Property<kotlin/String>|
|
||||
private final val anyProperty: R|Property<kotlin/Any!>| = R|/Property.Property|<R|kotlin/Any!|>()
|
||||
private get(): R|Property<kotlin/Any!>|
|
||||
private final val boundedProperty: R|Property<kotlin/String!>| = R|/Property.Property|<R|kotlin/String!|>()
|
||||
private get(): R|Property<kotlin/String!>|
|
||||
public final fun test_1(x: R|Property<kotlin/Any>|): R|kotlin/Unit| {
|
||||
when () {
|
||||
(R|<local>/x| is R|Reference|) -> {
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ FILE: main.kt
|
||||
public final typealias ImmutableSet<E> = R|MySet<E>|
|
||||
private final typealias ImmutableMultimap<K, V> = R|ImmutableMap<K, ImmutableSet<V>>|
|
||||
private final fun <K, V> R|ImmutableMultimap<K, V>|.put(key: R|K|, value: R|V|, oldSet: R|ImmutableSet<V>|): R|ImmutableMultimap<K, V>| {
|
||||
^put this@R|/put|.R|SubstitutionOverride</MyMap.put: R|ft<MyMap<ft<K & Any, K?>, ft<ImmutableSet<V>, ImmutableSet<V>?>>, MyMap<ft<K & Any, K?>, ft<ImmutableSet<V>, ImmutableSet<V>?>>?>|>|(R|<local>/key|, R|<local>/oldSet|.R|SubstitutionOverride</MySet.add: R|ft<MySet<ft<V & Any, V?>>, MySet<ft<V & Any, V?>>?>|>|(R|<local>/value|))
|
||||
^put this@R|/put|.R|SubstitutionOverride</MyMap.put: R|ft<MyMap<K!, ft<ImmutableSet<V>, ImmutableSet<V>?>>, MyMap<K!, ft<ImmutableSet<V>, ImmutableSet<V>?>>?>|>|(R|<local>/key|, R|<local>/oldSet|.R|SubstitutionOverride</MySet.add: R|ft<MySet<V!>, MySet<V!>?>|>|(R|<local>/value|))
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ FILE: concurrentMapOfAliases.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val foo: R|java/util/concurrent/ConcurrentHashMap<kotlin/String, kotlin/CharSequence>| = Q|java/util/concurrent|.R|java/util/concurrent/ConcurrentHashMap.ConcurrentHashMap|<R|kotlin/String|, R|kotlin/CharSequence|>()
|
||||
private get(): R|java/util/concurrent/ConcurrentHashMap<kotlin/String, kotlin/CharSequence>|
|
||||
private final val foo: R|java/util/concurrent/ConcurrentHashMap<kotlin/String!, kotlin/CharSequence!>| = Q|java/util/concurrent|.R|java/util/concurrent/ConcurrentHashMap.ConcurrentHashMap|<R|kotlin/String!|, R|kotlin/CharSequence!|>()
|
||||
private get(): R|java/util/concurrent/ConcurrentHashMap<kotlin/String!, kotlin/CharSequence!>|
|
||||
|
||||
private final fun bar(): R|kotlin/Unit| {
|
||||
this@R|/A|.R|/A.foo|.R|SubstitutionOverride<java/util/concurrent/ConcurrentHashMap.get: R|@EnhancedNullability kotlin/CharSequence?|>|(String(dd))?.{ (this@R|/A|, $subj$).R|/A.baz|() }
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@ FILE: use.kt
|
||||
}
|
||||
public abstract interface PersistentStateComponent<T> : R|kotlin/Any| {
|
||||
}
|
||||
public final fun <T> deserializeAndLoadState(component: R|PersistentStateComponent<T>|, clazz: R|java/lang/Class<T>| = Q|ComponentSerializationUtil|.R|/ComponentSerializationUtil.getStateClass*s|<R|ft<T & Any, T?>|>(<getClass>(R|<local>/component|).R|kotlin/jvm/java|<R|CapturedType(out PersistentStateComponent<T>)|>)): R|kotlin/Unit| {
|
||||
public final fun <T> deserializeAndLoadState(component: R|PersistentStateComponent<T>|, clazz: R|java/lang/Class<T>| = Q|ComponentSerializationUtil|.R|/ComponentSerializationUtil.getStateClass*s|<R|T!|>(<getClass>(R|<local>/component|).R|kotlin/jvm/java|<R|CapturedType(out PersistentStateComponent<T>)|>)): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun use(beforeRunTask: R|BeforeRunTask<*>|): R|kotlin/Unit| {
|
||||
when () {
|
||||
|
||||
+1
-1
@@ -4,5 +4,5 @@ FILE: main.kt
|
||||
public final typealias ImmutableLinkedHashSet<E> = R|imm/LinkedHashSet<E>|
|
||||
private final typealias ImmutableMultimap<K, V> = R|ImmutableMap<K, ImmutableSet<V>>|
|
||||
private final fun <K, V> R|ImmutableMultimap<K, V>|.put(key: R|K|, value: R|V|): R|kotlin/Unit| {
|
||||
this@R|/put|.R|SubstitutionOverride<imm/Map.get: R|ft<imm/Option<ft<ImmutableSet<V>, ImmutableSet<V>?>>, imm/Option<ft<ImmutableSet<V>, ImmutableSet<V>?>>?>|>|(R|<local>/key|).R|SubstitutionOverride<imm/Option.getOrElse: R|ft<ImmutableSet<V>, ImmutableSet<V>?>|>|(Q|ImmutableLinkedHashSet|.R|imm/LinkedHashSet.empty*s|<R|V|>())
|
||||
this@R|/put|.R|SubstitutionOverride<imm/Map.get: R|ft<imm/Option<ft<ImmutableSet<V>, ImmutableSet<V>?>>, imm/Option<ft<ImmutableSet<V>, ImmutableSet<V>?>>?>|>|(R|<local>/key|).R|SubstitutionOverride<imm/Option.getOrElse: R|ft<ImmutableSet<V>, ImmutableSet<V>?>|>|(Q|ImmutableLinkedHashSet|.R|imm/LinkedHashSet.empty*s|<R|V!|>())
|
||||
}
|
||||
|
||||
compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/genericGetterForSyntheticProperty.fir.txt
Vendored
+1
-1
@@ -3,5 +3,5 @@ FILE: test.kt
|
||||
lval foo: <ERROR TYPE REF: Unresolved name: foo> = R|<local>/some|.<Unresolved name: foo>#
|
||||
lval baz: <ERROR TYPE REF: Unresolved name: foo> = R|<local>/some|.<Unresolved name: foo>#<R|kotlin/String|>
|
||||
lval getFoo: <ERROR TYPE REF: Cannot infer argument for type parameter T> = R|<local>/some|.R|/Some.getFoo<CS errors: /Some.getFoo>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>()
|
||||
lval getBaz: R|kotlin/String!| = R|<local>/some|.R|/Some.getFoo|<R|kotlin/String|>()
|
||||
lval getBaz: R|kotlin/String!| = R|<local>/some|.R|/Some.getFoo|<R|kotlin/String!|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FILE: javaLangComparator.kt
|
||||
public final fun test_2(list: R|kotlin/collections/List<kotlin/Int>|): R|kotlin/Unit| {
|
||||
lval comp: R|java/util/Comparator<kotlin/Int>| = Q|java/util|.R|java/util/Comparator|<R|kotlin/Int|>(<L> = Comparator@fun <anonymous>(x: R|kotlin/Int!|, y: R|kotlin/Int!|): R|kotlin/Int| <inline=NoInline> {
|
||||
lval comp: R|java/util/Comparator<kotlin/Int!>| = Q|java/util|.R|java/util/Comparator|<R|kotlin/Int!|>(<L> = Comparator@fun <anonymous>(x: R|kotlin/Int!|, y: R|kotlin/Int!|): R|kotlin/Int| <inline=NoInline> {
|
||||
^ Int(1)
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: NamedParameterInConcurrentMap.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lval map: R|java/util/concurrent/ConcurrentHashMap<kotlin/String, kotlin/String>| = R|java/util/concurrent/ConcurrentHashMap.ConcurrentHashMap|<R|kotlin/String|, R|kotlin/String|>()
|
||||
lval map: R|java/util/concurrent/ConcurrentHashMap<kotlin/String!, kotlin/String!>| = R|java/util/concurrent/ConcurrentHashMap.ConcurrentHashMap|<R|kotlin/String!|, R|kotlin/String!|>()
|
||||
R|<local>/map|.R|SubstitutionOverride<java/util/concurrent/ConcurrentHashMap.put: R|@EnhancedNullability kotlin/String?|>|(key = String(key), value = String(value))
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ FILE: Main.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lvar generic: R|ft<Raw type Generic<kotlin/Any!>, Generic<*>?>| = Q|Generic|.R|/Generic.raw*s|
|
||||
lvar inner1: R|ft<Raw type Generic.Inner<kotlin/Any!>, Generic.Inner<*>?>| = R|<local>/generic|.R|SubstitutionOverride</Generic.inner>|
|
||||
R|<local>/inner1| = R|/Generic.Generic|<R|kotlin/String|>().R|SubstitutionOverride</Generic.Inner.Inner>|()
|
||||
R|<local>/inner1| = R|/Generic.Generic|<R|kotlin/String!|>().R|SubstitutionOverride</Generic.Inner.Inner>|()
|
||||
lvar inner2: R|ft<Raw type Generic.Inner<kotlin/Any!>, Generic.Inner<*>?>| = R|<local>/generic|.R|SubstitutionOverride</Generic.rawInner>|
|
||||
R|<local>/inner2| = R|/Generic.Generic|<R|kotlin/String|>().R|SubstitutionOverride</Generic.Inner.Inner>|()
|
||||
R|<local>/inner2| = R|/Generic.Generic|<R|kotlin/String!|>().R|SubstitutionOverride</Generic.Inner.Inner>|()
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
FILE: weakHashMap.kt
|
||||
public final val someMap: R|java/util/WeakHashMap<kotlin/Any?, kotlin/Any?>| = R|java/util/WeakHashMap.WeakHashMap|<R|kotlin/Any?|, R|kotlin/Any?|>()
|
||||
public get(): R|java/util/WeakHashMap<kotlin/Any?, kotlin/Any?>|
|
||||
public final val someMap: R|java/util/WeakHashMap<kotlin/Any!, kotlin/Any!>| = R|java/util/WeakHashMap.WeakHashMap|<R|kotlin/Any!|, R|kotlin/Any!|>()
|
||||
public get(): R|java/util/WeakHashMap<kotlin/Any!, kotlin/Any!>|
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
R|/someMap|.R|SubstitutionOverride<java/util/WeakHashMap.get: R|@EnhancedNullability kotlin/Any?|>|(String())
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,9 +9,9 @@ FILE: typeAliasWithForEach.kt
|
||||
}
|
||||
public final typealias Arguments = R|kotlin/collections/Map<kotlin/String, ArgsInfo>|
|
||||
public final fun R|Arguments|.deepCopy(): R|Arguments| {
|
||||
lval result: R|java/util/HashMap<kotlin/String, ArgsInfo>| = R|java/util/HashMap.HashMap|<R|kotlin/String|, R|ArgsInfo|>()
|
||||
lval result: R|java/util/HashMap<kotlin/String!, ArgsInfo!>| = R|java/util/HashMap.HashMap|<R|kotlin/String!|, R|ArgsInfo!|>()
|
||||
this@R|/deepCopy|.R|SubstitutionOverride<kotlin/collections/Map.forEach: R|kotlin/Unit|>|(<L> = SAM(forEach@fun <anonymous>(key: R|@EnhancedNullability kotlin/String|, value: R|@EnhancedNullability ArgsInfo|): R|kotlin/Unit| <inline=NoInline> {
|
||||
R|<local>/result|.R|kotlin/collections/set|<R|kotlin/String|, R|ArgsInfo|>(R|<local>/key|, R|/ArgsInfoImpl.ArgsInfoImpl|(R|<local>/value|))
|
||||
R|<local>/result|.R|kotlin/collections/set|<R|kotlin/String!|, R|ArgsInfo!|>(R|<local>/key|, R|/ArgsInfoImpl.ArgsInfoImpl|(R|<local>/value|))
|
||||
Unit
|
||||
}
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user