Synthetic accessors for class object private members

#KT-3338 Fixed
This commit is contained in:
Mikhael Bogdanov
2013-06-10 18:14:05 +04:00
parent 4ef2f997ed
commit 47fe81471a
32 changed files with 542 additions and 146 deletions
@@ -277,12 +277,63 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
}
@TestMetadata("compiler/testData/writeFlags/function")
@InnerTestClasses({Function.DeprecatedFlag.class})
@InnerTestClasses({Function.ClassObjectPrivate.class, Function.Constructors.class, Function.DeprecatedFlag.class})
public static class Function extends AbstractWriteFlagsTest {
public void testAllFilesPresentInFunction() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/function"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("compiler/testData/writeFlags/function/classObjectPrivate")
public static class ClassObjectPrivate extends AbstractWriteFlagsTest {
public void testAllFilesPresentInClassObjectPrivate() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/function/classObjectPrivate"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("privateFun.kt")
public void testPrivateFun() throws Exception {
doTest("compiler/testData/writeFlags/function/classObjectPrivate/privateFun.kt");
}
@TestMetadata("privateVal.kt")
public void testPrivateVal() throws Exception {
doTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVal.kt");
}
@TestMetadata("privateVar.kt")
public void testPrivateVar() throws Exception {
doTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVar.kt");
}
}
@TestMetadata("compiler/testData/writeFlags/function/constructors")
public static class Constructors extends AbstractWriteFlagsTest {
public void testAllFilesPresentInConstructors() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeFlags/function/constructors"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("classObject.kt")
public void testClassObject() throws Exception {
doTest("compiler/testData/writeFlags/function/constructors/classObject.kt");
}
@TestMetadata("objectInClass.kt")
public void testObjectInClass() throws Exception {
doTest("compiler/testData/writeFlags/function/constructors/objectInClass.kt");
}
@TestMetadata("objectLiteral.kt")
public void testObjectLiteral() throws Exception {
doTest("compiler/testData/writeFlags/function/constructors/objectLiteral.kt");
}
@TestMetadata("topLevelObject.kt")
public void testTopLevelObject() throws Exception {
doTest("compiler/testData/writeFlags/function/constructors/topLevelObject.kt");
}
}
@TestMetadata("compiler/testData/writeFlags/function/deprecatedFlag")
public static class DeprecatedFlag extends AbstractWriteFlagsTest {
public void testAllFilesPresentInDeprecatedFlag() throws Exception {
@@ -354,6 +405,8 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
public static Test innerSuite() {
TestSuite suite = new TestSuite("Function");
suite.addTestSuite(Function.class);
suite.addTestSuite(ClassObjectPrivate.class);
suite.addTestSuite(Constructors.class);
suite.addTestSuite(DeprecatedFlag.class);
return suite;
}
@@ -20,6 +20,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorResolver;
import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
import org.jetbrains.jet.lang.resolve.TypeResolver;
import org.jetbrains.jet.lang.resolve.calls.CallResolver;
import org.jetbrains.jet.lang.resolve.calls.NeedSyntheticCallResolverExtension;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
import com.intellij.openapi.project.Project;
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
@@ -38,6 +39,7 @@ public class InjectorForTests {
private ExpressionTypingServices expressionTypingServices;
private TypeResolver typeResolver;
private CallResolver callResolver;
private NeedSyntheticCallResolverExtension needSyntheticCallResolverExtension;
private KotlinBuiltIns kotlinBuiltIns;
private final Project project;
private final ModuleDescriptor moduleDescriptor;
@@ -55,6 +57,7 @@ public class InjectorForTests {
this.expressionTypingServices = new ExpressionTypingServices();
this.typeResolver = new TypeResolver();
this.callResolver = new CallResolver();
this.needSyntheticCallResolverExtension = new NeedSyntheticCallResolverExtension();
this.kotlinBuiltIns = KotlinBuiltIns.getInstance();
this.project = project;
this.moduleDescriptor = moduleDescriptor;
@@ -82,6 +85,7 @@ public class InjectorForTests {
this.callResolver.setArgumentTypeResolver(argumentTypeResolver);
this.callResolver.setCandidateResolver(candidateResolver);
this.callResolver.setExpressionTypingServices(expressionTypingServices);
this.callResolver.setExtension(needSyntheticCallResolverExtension);
this.callResolver.setTypeResolver(typeResolver);
annotationResolver.setCallResolver(callResolver);