diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 49837a3806d..c217b072e67 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -8,11 +8,11 @@
+
+
-
-
-
-
+
+
@@ -82,36 +82,9 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -121,10 +94,64 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -139,35 +166,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -213,7 +211,7 @@
-
+
@@ -301,11 +299,6 @@
@@ -466,7 +464,11 @@
-
+
+
+
+
+
@@ -484,7 +486,7 @@
-
+
@@ -908,36 +910,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -945,7 +918,7 @@
-
+
@@ -956,7 +929,7 @@
-
+
@@ -977,7 +950,7 @@
-
+
@@ -988,7 +961,7 @@
-
+
@@ -1041,6 +1014,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1137,11 +1144,11 @@
-
-
-
-
-
+
+
+
+
+
localhost
@@ -1215,7 +1222,7 @@
-
+
@@ -1259,7 +1266,7 @@
-
+
@@ -1272,7 +1279,6 @@
-
@@ -1297,6 +1303,7 @@
+
@@ -1306,92 +1313,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1422,7 +1343,86 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java
index 63a252992d1..513543e998b 100644
--- a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java
+++ b/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java
@@ -33,7 +33,7 @@ public final class NamespaceTranslator extends AbstractTranslator {
super(context.newNamespace(namespace));
this.namespace = namespace;
this.namespaceName = context.getNameForElement(namespace);
- this.classDeclarationTranslator = new ClassDeclarationTranslator(context, namespace);
+ this.classDeclarationTranslator = new ClassDeclarationTranslator(context(), namespace);
}
@NotNull
diff --git a/translator/test/org/jetbrains/k2js/test/PropertyAccessorTest.java b/translator/test/org/jetbrains/k2js/test/PropertyAccessTest.java
similarity index 80%
rename from translator/test/org/jetbrains/k2js/test/PropertyAccessorTest.java
rename to translator/test/org/jetbrains/k2js/test/PropertyAccessTest.java
index a57e4062b09..a14a481ec16 100644
--- a/translator/test/org/jetbrains/k2js/test/PropertyAccessorTest.java
+++ b/translator/test/org/jetbrains/k2js/test/PropertyAccessTest.java
@@ -5,7 +5,7 @@ import org.junit.Test;
/**
* @author Talanov Pavel
*/
-public final class PropertyAccessorTest extends TranslationTest {
+public final class PropertyAccessTest extends TranslationTest {
final private static String MAIN = "propertyAccess/";
@@ -60,9 +60,15 @@ public final class PropertyAccessorTest extends TranslationTest {
}
//TODO test
-// @Test
-// public void namespaceCustomAccessors() throws Exception {
-// testFooBoxIsTrue("namespaceCustomAccessors.kt");
-// }
+ @Test
+ public void namespaceCustomAccessors() throws Exception {
+ testFooBoxIsTrue("namespaceCustomAccessors.kt");
+ }
+
+
+ @Test
+ public void classUsesNamespaceProperties() throws Exception {
+ testFooBoxIsTrue("classUsesNamespaceProperties.kt");
+ }
}
diff --git a/translator/testFiles/propertyAccess/cases/classUsesNamespaceProperties.kt b/translator/testFiles/propertyAccess/cases/classUsesNamespaceProperties.kt
new file mode 100644
index 00000000000..00557149ad2
--- /dev/null
+++ b/translator/testFiles/propertyAccess/cases/classUsesNamespaceProperties.kt
@@ -0,0 +1,17 @@
+namespace foo
+
+var a = 0
+
+class A() {
+ {
+ a++
+ }
+
+}
+
+ fun box() : Boolean {
+ var c = A()
+ c = A()
+ c = A()
+ return (a == 3)
+ }
\ No newline at end of file
diff --git a/translator/testFiles/propertyAccess/cases/namespaceCustomAccessors.kt b/translator/testFiles/propertyAccess/cases/namespaceCustomAccessors.kt
index 2804b0773fb..843a83b6876 100644
--- a/translator/testFiles/propertyAccess/cases/namespaceCustomAccessors.kt
+++ b/translator/testFiles/propertyAccess/cases/namespaceCustomAccessors.kt
@@ -1,6 +1,8 @@
namespace foo
var a : Int
+
+
get() {
return 5
}
@@ -8,10 +10,6 @@ set(b) {
}
-{
- $a = 3;
-}
-
fun box() : Boolean {
return (a == 5)
}
\ No newline at end of file