From 8bcae808778e854dd7ee75cd17f6f5f1aa8eb65d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 29 Nov 2019 16:01:35 +0300 Subject: [PATCH] [FIR TEST]: add test with Map.Entry-based J/K hierarchy --- .../testData/resolve/stdlib/j+k/MapEntry.kt | 23 +++++++++++++++++++ .../testData/resolve/stdlib/j+k/MapEntry.txt | 13 +++++++++++ ...FirDiagnosticsWithStdlibTestGenerated.java | 5 ++++ 3 files changed, 41 insertions(+) create mode 100644 compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.kt create mode 100644 compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.txt diff --git a/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.kt b/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.kt new file mode 100644 index 00000000000..e96cc1d89d0 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.kt @@ -0,0 +1,23 @@ +// FILE: Test.java + +import java.lang.*; +import java.util.*; + +public class Test { + public static class MapEntryImpl implements Map.Entry { + public String getKey() { return null; } + public String getValue() { return null; } + public String setValue(String s) { return null; } + } +} + +// FILE: main.kt + +class MyMapEntry : Test.MapEntryImpl() + +fun test() { + val b = MyMapEntry() + b.key + b.value + b.setValue(null) +} diff --git a/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.txt b/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.txt new file mode 100644 index 00000000000..61f54feae89 --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.txt @@ -0,0 +1,13 @@ +FILE: main.kt + public final class MyMapEntry : R|Test.MapEntryImpl| { + public constructor(): R|MyMapEntry| { + super() + } + + } + public final fun test(): R|kotlin/Unit| { + lval b: R|MyMapEntry| = R|/MyMapEntry.MyMapEntry|() + R|/b|.R|/Test.MapEntryImpl.key| + R|/b|.R|/Test.MapEntryImpl.value| + R|/b|.R|/Test.MapEntryImpl.setValue|(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 24fba135acb..1524e97e256 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java @@ -489,6 +489,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/LoggerInstance.kt"); } + @TestMetadata("MapEntry.kt") + public void testMapEntry() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/MapEntry.kt"); + } + @TestMetadata("MyException.kt") public void testMyException() throws Exception { runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/MyException.kt");