diff --git a/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.kt b/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.kt new file mode 100644 index 00000000000..6cc15860220 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.kt @@ -0,0 +1,8 @@ +val Any?.meaning: Int + get() = 42 + +fun test() { + val f = Any?::meaning + f.get(null) + f.get("") +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.txt b/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.txt new file mode 100644 index 00000000000..8e626e50dfa --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.txt @@ -0,0 +1,10 @@ +FILE: getOnKProperty.kt + public final val R|kotlin/Any?|.meaning: R|kotlin/Int| + public get(): R|kotlin/Int| { + ^ Int(42) + } + public final fun test(): R|kotlin/Unit| { + lval f: R|kotlin/reflect/KProperty1| = Q|kotlin/Any|::R|/meaning| + R|/f|.#(Null(null)) + R|/f|.R|FakeOverride|(String()) + } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.kt b/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.kt new file mode 100644 index 00000000000..09b29f723a7 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.kt @@ -0,0 +1,3 @@ +fun test(map: java.util.AbstractMap) { + map.remove("", null) +} \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.txt b/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.txt new file mode 100644 index 00000000000..2066a337a23 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.txt @@ -0,0 +1,4 @@ +FILE: removeOnAbstractMap.kt + public final fun test(map: R|java/util/AbstractMap|): R|kotlin/Unit| { + R|/map|.#(String(), Null(null)) + } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java index 9af89027099..f13578b9a2e 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java @@ -103,6 +103,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic runTest("compiler/fir/resolve/testData/resolve/stdlib/functionX.kt"); } + @TestMetadata("getOnKProperty.kt") + public void testGetOnKProperty() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/stdlib/getOnKProperty.kt"); + } + @TestMetadata("hashMapTypeAlias.kt") public void testHashMapTypeAlias() throws Exception { runTest("compiler/fir/resolve/testData/resolve/stdlib/hashMapTypeAlias.kt"); @@ -188,6 +193,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic runTest("compiler/fir/resolve/testData/resolve/stdlib/reflectionClass.kt"); } + @TestMetadata("removeOnAbstractMap.kt") + public void testRemoveOnAbstractMap() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/stdlib/removeOnAbstractMap.kt"); + } + @TestMetadata("runOnIntegerLiteral.kt") public void testRunOnIntegerLiteral() throws Exception { runTest("compiler/fir/resolve/testData/resolve/stdlib/runOnIntegerLiteral.kt");