From b44c6f2d6ef90491669d5b0caf8e5e3057806675 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 17 Aug 2012 20:26:27 +0400 Subject: [PATCH] Tests for redeclarations with multi-decls --- .../RedeclarationsInMultiDecl.kt | 15 +++++++++++++++ .../jet/checkers/JetDiagnosticsTestGenerated.java | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt diff --git a/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt new file mode 100644 index 00000000000..5dadc89b695 --- /dev/null +++ b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt @@ -0,0 +1,15 @@ +class A { + fun component1() : Int = 1 + fun component2() : Int = 2 +} + +fun a() { + val (a, a) = A() + val (x, y) = A(); + val b = 1 + use(b) + val (b, y) = A(); +} + + +fun use(a: Any): Any = a \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 893a825ff51..37aa7febb9b 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -1088,6 +1088,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage doTest("compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt"); } + @TestMetadata("RedeclarationsInMultiDecl.kt") + public void testRedeclarationsInMultiDecl() throws Exception { + doTest("compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt"); + } + } @TestMetadata("compiler/testData/diagnostics/tests/extensions")