From 9d3fa7da80e41e51aca69b40cf3adddf573c00b5 Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Fri, 6 Nov 2015 12:17:07 +0300 Subject: [PATCH] Test for obsolete KT-8189: java.lang.UnsupportedOperationException: Don't know how to generate #KT-8189 Obsolete --- .../diagnostics/tests/regressions/noThis.kt | 10 ++++ .../diagnostics/tests/regressions/noThis.txt | 48 +++++++++++++++++++ .../checkers/DiagnosticsTestGenerated.java | 6 +++ 3 files changed, 64 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/regressions/noThis.kt create mode 100644 compiler/testData/diagnostics/tests/regressions/noThis.txt diff --git a/compiler/testData/diagnostics/tests/regressions/noThis.kt b/compiler/testData/diagnostics/tests/regressions/noThis.kt new file mode 100644 index 00000000000..b63745531ba --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/noThis.kt @@ -0,0 +1,10 @@ +interface A { fun f() } + +open class P(val z: B) + +class B : A { + override fun f() {} + class C : A by this {} + class D(val x : B = this) + class E : P(this) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/noThis.txt b/compiler/testData/diagnostics/tests/regressions/noThis.txt new file mode 100644 index 00000000000..e686132765c --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/noThis.txt @@ -0,0 +1,48 @@ +package + +public interface A { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun f(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : A { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ fun f(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class C : A { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*delegation*/ fun f(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class D { + public constructor D(/*0*/ x: B = ...) + public final val x: B + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class E : P { + public constructor E() + public final override /*1*/ /*fake_override*/ val z: B + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +public open class P { + public constructor P(/*0*/ z: B) + public final val z: B + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 2d8337d718a..87aa674afb9 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -12819,6 +12819,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("noThis.kt") + public void testNoThis() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/noThis.kt"); + doTest(fileName); + } + @TestMetadata("OrphanStarProjection.kt") public void testOrphanStarProjection() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/OrphanStarProjection.kt");