FIR: Refine inference constraints when type variable in flexible position
That issue might be fixed via changing TypeVariableMarker.shouldBeFlexible at ConeConstraintSystemUtilContext but this and some other tricks have been added because of incorrect handling of constraints where type variable has a flexible bound ^KT-51168 Fixed
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ FILE: concurrentMapOfAliases.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val foo: R|java/util/concurrent/ConcurrentHashMap<ft<kotlin/String, kotlin/String?>, ft<kotlin/CharSequence, kotlin/CharSequence?>>| = Q|java/util/concurrent|.R|java/util/concurrent/ConcurrentHashMap.ConcurrentHashMap|<R|ft<kotlin/String, kotlin/String?>|, R|ft<kotlin/CharSequence, kotlin/CharSequence?>|>()
|
||||
private get(): R|java/util/concurrent/ConcurrentHashMap<ft<kotlin/String, kotlin/String?>, ft<kotlin/CharSequence, 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|kotlin/CharSequence?|>|(String(dd))?.{ (this@R|/A|, $subj$).R|/A.baz|() }
|
||||
|
||||
+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|<R|ft<V, 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|<R|V|>())
|
||||
}
|
||||
|
||||
+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<ft<kotlin/Int, kotlin/Int?>>| = Q|java/util|.R|java/util/Comparator|<R|ft<kotlin/Int, kotlin/Int?>|>(<L> = Comparator@fun <anonymous>(x: R|ft<kotlin/Int, kotlin/Int?>|, y: R|ft<kotlin/Int, 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|ft<kotlin/Int, kotlin/Int?>|, y: R|ft<kotlin/Int, kotlin/Int?>|): R|kotlin/Int| <inline=NoInline> {
|
||||
^ Int(1)
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FILE: kotlinComparatorAlias.kt
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
lval comp: R|java/util/Comparator<ft<kotlin/Int, kotlin/Int?>>| = R|java/util/Comparator|<R|ft<kotlin/Int, kotlin/Int?>|>(<L> = Comparator@fun <anonymous>(x: R|ft<kotlin/Int, kotlin/Int?>|, y: R|ft<kotlin/Int, kotlin/Int?>|): R|kotlin/Int| <inline=NoInline> {
|
||||
lval comp: R|java/util/Comparator<kotlin/Int>| = R|java/util/Comparator|<R|kotlin/Int|>(<L> = Comparator@fun <anonymous>(x: R|ft<kotlin/Int, kotlin/Int?>|, y: R|ft<kotlin/Int, kotlin/Int?>|): R|kotlin/Int| <inline=NoInline> {
|
||||
^ Int(1)
|
||||
}
|
||||
)
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
FILE: weakHashMap.kt
|
||||
public final val someMap: R|java/util/WeakHashMap<ft<kotlin/Any, kotlin/Any?>, ft<kotlin/Any, kotlin/Any?>>| = R|java/util/WeakHashMap.WeakHashMap|<R|ft<kotlin/Any, kotlin/Any?>|, R|ft<kotlin/Any, kotlin/Any?>|>()
|
||||
public get(): R|java/util/WeakHashMap<ft<kotlin/Any, kotlin/Any?>, ft<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|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<ft<kotlin/String, kotlin/String?>, ft<ArgsInfo, ArgsInfo?>>| = R|java/util/HashMap.HashMap|<R|ft<kotlin/String, kotlin/String?>|, R|ft<ArgsInfo, 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> = 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|ft<kotlin/String, kotlin/String?>|, R|ft<ArgsInfo, 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|))
|
||||
}
|
||||
)
|
||||
^deepCopy R|<local>/result|
|
||||
|
||||
Reference in New Issue
Block a user