From 34dfcef9789a02853022a7047877fd5458b4954a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 31 May 2012 20:25:09 +0200 Subject: [PATCH] version that fails with assertion at org.jetbrains.jet.lang.resolve.OverrideResolver.checkOverrideForMember(OverrideResolver.java:370) --- .../j2k/ast/DummyMethodCallExpression.java | 40 ------------------- .../jet/j2k/ast/DummyMethodCallExpression.kt | 8 ++++ .../jet/j2k/ast/DummyStringExpression.java | 36 ----------------- .../jet/j2k/ast/DummyStringExpression.kt | 6 +++ 4 files changed, 14 insertions(+), 76 deletions(-) delete mode 100644 src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.java create mode 100644 src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.kt delete mode 100644 src/org/jetbrains/jet/j2k/ast/DummyStringExpression.java create mode 100644 src/org/jetbrains/jet/j2k/ast/DummyStringExpression.kt diff --git a/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.java b/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.java deleted file mode 100644 index afada0ea95a..00000000000 --- a/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.j2k.ast; - -import org.jetbrains.annotations.NotNull; - -/** - * @author ignatov - */ -public class DummyMethodCallExpression extends Expression { - private final Element myWho; - private final String myMethodName; - private final Element myWhat; - - public DummyMethodCallExpression(Element who, String methodName, Element what) { - myWho = who; - myMethodName = methodName; - myWhat = what; - } - - @NotNull - @Override - public String toKotlin() { - return myWho.toKotlin() + DOT + myMethodName + "(" + myWhat.toKotlin() + ")"; - } -} diff --git a/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.kt b/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.kt new file mode 100644 index 00000000000..f9e70457167 --- /dev/null +++ b/src/org/jetbrains/jet/j2k/ast/DummyMethodCallExpression.kt @@ -0,0 +1,8 @@ +package org.jetbrains.jet.j2k.ast + + +public open class DummyMethodCallExpression(val who: Element, val methodName: String, val what: Element): Expression() { + public override fun toKotlin(): String { + return who.toKotlin() + "." + methodName + "(" + what.toKotlin() + ")" + } +} diff --git a/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.java b/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.java deleted file mode 100644 index d8456d9033c..00000000000 --- a/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.j2k.ast; - -import org.jetbrains.annotations.NotNull; - -/** - * @author ignatov - */ -public class DummyStringExpression extends Expression { - private final String myString; - - public DummyStringExpression(String string) { - myString = string; - } - - @NotNull - @Override - public String toKotlin() { - return myString; - } -} diff --git a/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.kt b/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.kt new file mode 100644 index 00000000000..3583bb8ae4a --- /dev/null +++ b/src/org/jetbrains/jet/j2k/ast/DummyStringExpression.kt @@ -0,0 +1,6 @@ +package org.jetbrains.jet.j2k.ast + + +public open class DummyStringExpression(val string: String): Expression() { + public override fun toKotlin() = string +}