FIR: Support proper loading of Map.merge
This commit is contained in:
@@ -116,6 +116,10 @@ private fun StringBuilder.appendConeType(coneType: ConeKotlinType) {
|
||||
appendClassLikeType(representative.coneTypeUnsafe())
|
||||
}
|
||||
}
|
||||
is ConeDefinitelyNotNullType -> {
|
||||
appendConeType(coneType.original)
|
||||
return
|
||||
}
|
||||
is ConeFlexibleType -> {
|
||||
appendConeType(coneType.lowerBound)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// FULL_JDK
|
||||
|
||||
fun foo(x: MutableMap<String, List<String>>) {
|
||||
x.merge("", listOf("")) { a, b -> a + b }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
FILE: mapMerge.kt
|
||||
public final fun foo(x: R|kotlin/collections/MutableMap<kotlin/String, kotlin/collections/List<kotlin/String>>|): R|kotlin/Unit| {
|
||||
R|<local>/x|.R|FakeOverride<java/util/Map.merge: R|kotlin/collections/List<kotlin/String>?|>|(String(), R|kotlin/collections/listOf|<R|kotlin/String|>(String()), <L> = merge@fun <anonymous>(a: R|ft<kotlin/collections/List<kotlin/String>, kotlin/collections/List<kotlin/String>?>!|, b: R|ft<kotlin/collections/List<kotlin/String>, kotlin/collections/List<kotlin/String>?>!|): R|ft<kotlin/collections/List<kotlin/String>, kotlin/collections/List<kotlin/String>?>!| {
|
||||
^ R|<local>/a|.R|kotlin/collections/plus|<R|kotlin/String|>(R|<local>/b|)
|
||||
}
|
||||
)
|
||||
}
|
||||
Generated
+5
@@ -645,6 +645,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
|
||||
runTest("compiler/fir/resolve/testData/resolveWithStdlib/j+k/MapEntry.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mapMerge.kt")
|
||||
public void testMapMerge() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolveWithStdlib/j+k/mapMerge.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MyException.kt")
|
||||
public void testMyException() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyException.kt");
|
||||
|
||||
Reference in New Issue
Block a user