diff --git a/.idea/modules.xml b/.idea/modules.xml
index 363ff6ece3a..c5d66f65273 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -3,6 +3,7 @@
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6ab1399ba54..11120bbb061 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -14,10 +14,14 @@
-
-
-
-
+
+
+
+
+
+
+
+
@@ -121,7 +125,7 @@
-
+
@@ -182,8 +186,8 @@
-
+
@@ -191,67 +195,40 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -260,14 +237,14 @@
-
+
-
-
+
+
@@ -275,10 +252,37 @@
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -288,28 +292,37 @@
-
+
-
+
-
-
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
@@ -318,12 +331,8 @@
-
-
-
-
-
-
+
+
@@ -337,15 +346,6 @@
-
-
-
-
-
-
-
-
-
@@ -406,22 +406,22 @@
@@ -639,6 +639,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -671,6 +681,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -707,7 +761,7 @@
-
+
@@ -715,6 +769,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -773,6 +875,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -837,16 +949,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -866,9 +968,9 @@
-
-
+
+
@@ -887,7 +989,35 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -895,7 +1025,7 @@
-
+
@@ -916,20 +1046,44 @@
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -944,39 +1098,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -985,40 +1107,11 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1091,6 +1184,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -1117,17 +1221,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -1189,11 +1282,11 @@
-
-
-
-
-
+
+
+
+
+
localhost
@@ -1269,7 +1362,7 @@
-
+
@@ -1313,7 +1406,7 @@
-
+
@@ -1326,8 +1419,6 @@
-
-
@@ -1351,6 +1442,8 @@
+
+
@@ -1360,121 +1453,114 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
+
@@ -1534,7 +1620,7 @@
- backend
+ translator
diff --git a/translator/src/org/jetbrains/k2js/K2JSTranslator.java b/translator/src/org/jetbrains/k2js/K2JSTranslator.java
index 2e0aed691d2..41c01799e7a 100644
--- a/translator/src/org/jetbrains/k2js/K2JSTranslator.java
+++ b/translator/src/org/jetbrains/k2js/K2JSTranslator.java
@@ -11,8 +11,8 @@ import com.intellij.psi.impl.PsiFileFactoryImpl;
import com.intellij.testFramework.LightVirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.jetbrains.jet.JetCoreEnvironment;
import org.jetbrains.jet.compiler.CompileEnvironment;
+import org.jetbrains.jet.compiler.JetCoreEnvironment;
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
diff --git a/translator/src/org/jetbrains/k2js/translate/context/Namer.java b/translator/src/org/jetbrains/k2js/translate/context/Namer.java
index 624d678e004..1146f209380 100644
--- a/translator/src/org/jetbrains/k2js/translate/context/Namer.java
+++ b/translator/src/org/jetbrains/k2js/translate/context/Namer.java
@@ -37,7 +37,8 @@ public final class Namer {
return "classes";
}
- public static String getNameForAccessor(String propertyName, boolean isGetter) {
+ @NotNull
+ public static String getNameForAccessor(@NotNull String propertyName, boolean isGetter) {
if (isGetter) {
return getNameForGetter(propertyName);
} else {
diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java
index 81c287c2457..ee10296ae7d 100644
--- a/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java
+++ b/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java
@@ -50,7 +50,7 @@ public final class ClassDeclarationTranslator extends AbstractTranslator {
declarationsObject = context().jsScope().declareName(Namer.nameForClassesVariable());
assert declarationsObject != null;
declarationsStatement =
- AstUtil.newAssignmentStatement(declarationsObject.makeRef(), generateDummyFunctionInvocation());
+ AstUtil.newVar(declarationsObject, generateDummyFunctionInvocation());
}
@NotNull
diff --git a/translator/test/org/jetbrains/k2js/test/FunctionTest.java b/translator/test/org/jetbrains/k2js/test/FunctionTest.java
index 7291d1d1111..9882a4ea42c 100644
--- a/translator/test/org/jetbrains/k2js/test/FunctionTest.java
+++ b/translator/test/org/jetbrains/k2js/test/FunctionTest.java
@@ -74,6 +74,11 @@ public class FunctionTest extends AbstractExpressionTest {
testFooBoxIsTrue("functionLiteralAsLastParameter.kt");
}
+ @Test
+ public void namedArguments() throws Exception {
+ testFooBoxIsTrue("namedArguments.kt");
+ }
+
@Test
public void kt921() throws Exception {
try {
diff --git a/translator/testFiles/expression/function/cases/namedArguments.kt b/translator/testFiles/expression/function/cases/namedArguments.kt
new file mode 100644
index 00000000000..5511e10825f
--- /dev/null
+++ b/translator/testFiles/expression/function/cases/namedArguments.kt
@@ -0,0 +1,16 @@
+package foo
+
+fun test(x: Int, y: Int) = y - x
+
+fun box() : Boolean {
+ if (test(1,2) != 1) {
+ return false;
+ }
+ if (test(x=1, y=2) != 1) {
+ return false;
+ }
+ if (test(y=2, x=1) != 1) {
+ return false;
+ }
+ return true
+}
\ No newline at end of file
diff --git a/translator/translator.iml b/translator/translator.iml
index 0a4844c97a4..5d33453bb98 100644
--- a/translator/translator.iml
+++ b/translator/translator.iml
@@ -14,6 +14,7 @@
+