diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e0d40dee354..787292262ac 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -8,10 +8,8 @@
-
-
-
+
@@ -191,7 +189,7 @@
-
+
@@ -259,10 +257,19 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
@@ -272,20 +279,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -295,19 +288,28 @@
-
-
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
@@ -345,10 +347,10 @@
-
+
-
+
@@ -393,7 +395,6 @@
@@ -1200,7 +1202,7 @@
-
+
@@ -1244,7 +1246,7 @@
-
+
@@ -1257,7 +1259,6 @@
-
@@ -1282,6 +1283,7 @@
+
@@ -1291,48 +1293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1370,13 +1330,6 @@
-
-
-
-
-
-
-
@@ -1386,7 +1339,75 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java
index b7ebd35d06a..edf0f92c2de 100644
--- a/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java
+++ b/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java
@@ -106,7 +106,16 @@ public final class CallTranslator extends AbstractTranslator {
if (isConstructorDescriptor(descriptor)) {
return constructorCall();
}
- return AstUtil.newInvocation(qualifiedMethodReference(), arguments);
+ return AstUtil.newInvocation(calleeReference(), arguments);
+ }
+
+ @NotNull
+ private JsNameRef calleeReference() {
+ if (context().isDeclared(descriptor)) {
+ return qualifiedMethodReference();
+ }
+ //TODO: hack
+ return AstUtil.newQualifiedNameRef(descriptor.getName());
}
@NotNull
@@ -120,7 +129,7 @@ public final class CallTranslator extends AbstractTranslator {
@NotNull
private JsExpression constructorCall() {
- JsNew constructorCall = new JsNew(qualifiedMethodReference());
+ JsNew constructorCall = new JsNew(calleeReference());
constructorCall.setArguments(arguments);
return constructorCall;
}