From 0cd8534230e24b29ba744b4eef48481c49b2d237 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Mon, 4 Jun 2012 18:56:01 +0400 Subject: [PATCH] KT-2069 Cannot call super method when superclass has type parameters #KT-2069 fixed --- .../jet/lang/resolve/scopes/WritableScopeImpl.java | 7 ++++--- .../diagnostics/tests/subtyping/kt2069.jet | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/subtyping/kt2069.jet diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java index f77bbaa3564..c12f281453b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.java @@ -473,10 +473,11 @@ public class WritableScopeImpl extends WritableScopeWithImports { public void getImplicitReceiversHierarchy(@NotNull List result) { checkMayRead(); - if (implicitReceiver != null && implicitReceiver.exists()) { - result.add(implicitReceiver); - } super.getImplicitReceiversHierarchy(result); + + if (implicitReceiver != null && implicitReceiver.exists()) { + result.add(0, implicitReceiver); + } } // @SuppressWarnings({"NullableProblems"}) diff --git a/compiler/testData/diagnostics/tests/subtyping/kt2069.jet b/compiler/testData/diagnostics/tests/subtyping/kt2069.jet new file mode 100644 index 00000000000..92a5ff0157f --- /dev/null +++ b/compiler/testData/diagnostics/tests/subtyping/kt2069.jet @@ -0,0 +1,14 @@ +//KT-2069 Cannot call super method when superclass has type parameters +package kt2069 + +trait T1 { + fun foo() {} +} + +class T : T1 { + fun bar() { + super.foo() + } + + class object {} +} \ No newline at end of file