From 79ee8f452cb7c1cbfe85ed5f370443d5430cada7 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Fri, 7 Jul 2017 18:03:06 +0300 Subject: [PATCH] Add test for obsolete issue #KT-12688 Obsolete --- .../privateCandidatesWithWrongArguments.kt | 20 +++++++++++++++++++ .../privateCandidatesWithWrongArguments.txt | 5 +++++ .../checkers/DiagnosticsTestGenerated.java | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.txt diff --git a/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt new file mode 100644 index 00000000000..65dc762fb25 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt @@ -0,0 +1,20 @@ +// FILE: foo/A.java +package foo; + +public class A { + static void f(B b) { + b.g(); + } + + public interface B { + void g(); + } +} + +// FILE: bar/sample.kt + +package bar + +fun main() { + foo.A.f {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.txt b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.txt new file mode 100644 index 00000000000..a46f4432d26 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.txt @@ -0,0 +1,5 @@ +package + +package bar { + public fun main(): kotlin.Unit +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index a48fa2218ef..eaeb60e6b3a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -12573,6 +12573,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("privateCandidatesWithWrongArguments.kt") + public void testPrivateCandidatesWithWrongArguments() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt"); + doTest(fileName); + } + @TestMetadata("samOnTypeParameter.kt") public void testSamOnTypeParameter() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt");