From d9fd04dd43502bbee30a77e8ef8d6feb2fe9bad5 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Wed, 13 Mar 2013 12:03:42 +0400 Subject: [PATCH] Refactoring: code duplication removed from accessor generators --- .../jet/codegen/FunctionCodegen.java | 56 ++- .../jet/codegen/PropertyCodegen.java | 223 +++------- .../prop/defaultAccessors/ClassVal.kt | 13 + .../prop/defaultAccessors/ClassVal.txt | 15 + .../prop/defaultAccessors/ClassValParams.kt | 11 + .../prop/defaultAccessors/ClassValParams.txt | 15 + .../prop/defaultAccessors/ClassValWithGet.kt | 20 + .../prop/defaultAccessors/ClassValWithGet.txt | 15 + .../prop/defaultAccessors/ClassVar.kt | 15 + .../prop/defaultAccessors/ClassVar.txt | 20 + .../prop/defaultAccessors/ClassVarModality.kt | 18 + .../defaultAccessors/ClassVarModality.txt | 24 ++ .../prop/defaultAccessors/ClassVarParams.kt | 10 + .../prop/defaultAccessors/ClassVarParams.txt | 20 + .../prop/defaultAccessors/ClassVarWithGet.kt | 18 + .../prop/defaultAccessors/ClassVarWithGet.txt | 20 + .../prop/defaultAccessors/ClassVarWithSet.kt | 36 ++ .../prop/defaultAccessors/ClassVarWithSet.txt | 38 ++ .../prop/defaultAccessors/ExtValLong.kt | 9 + .../prop/defaultAccessors/ExtValLong.txt | 10 + .../prop/defaultAccessors/ExtVarLong.kt | 9 + .../prop/defaultAccessors/ExtVarLong.txt | 14 + .../defaultAccessors/ExtVarLongWithSet.kt | 28 ++ .../defaultAccessors/ExtVarLongWithSet.txt | 29 ++ .../PropertySetterIn.kt | 2 +- .../PropertySetterOut.kt | 2 +- .../AbstractLoadCompiledKotlinTest.java | 14 +- .../LoadCompiledKotlinTestGenerated.java | 398 ++++++++++-------- ...ractLazyResolveNamespaceComparingTest.java | 12 +- ...esolveNamespaceComparingTestGenerated.java | 398 ++++++++++-------- .../jet/test/util/NamespaceComparator.java | 31 +- .../jet/generators/tests/GenerateTests.java | 4 +- 32 files changed, 1026 insertions(+), 521 deletions(-) create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.txt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt create mode 100644 compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.txt diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index 2b925d3436c..2d4fea7fa85 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -37,9 +37,7 @@ import org.jetbrains.jet.codegen.state.GenerationStateAware; import org.jetbrains.jet.codegen.state.JetTypeMapper; import org.jetbrains.jet.codegen.state.JetTypeMapperMode; import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.psi.JetDeclarationWithBody; -import org.jetbrains.jet.lang.psi.JetFunctionLiteralExpression; -import org.jetbrains.jet.lang.psi.JetNamedFunction; +import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.java.JvmAbi; @@ -81,13 +79,16 @@ public class FunctionCodegen extends GenerationStateAware { generateMethod(f, method, true, null, functionDescriptor); } + public void generateMethod( - JetDeclarationWithBody fun, - JvmMethodSignature jvmSignature, + @NotNull PsiElement declaration, + @NotNull JvmMethodSignature jvmSignature, boolean needJetAnnotations, @Nullable String propertyTypeSignature, - FunctionDescriptor functionDescriptor + @NotNull FunctionDescriptor functionDescriptor ) { + assert declaration instanceof JetDeclarationWithBody || declaration instanceof JetProperty || declaration instanceof JetParameter; + checkMustGenerateCode(functionDescriptor); OwnerKind kind = owner.getContextKind(); @@ -96,9 +97,11 @@ public class FunctionCodegen extends GenerationStateAware { needJetAnnotations = false; } + boolean hasBodyExpression = hasBodyExpression(declaration); + MethodContext context = owner.intoFunction(functionDescriptor); - if (kind != OwnerKind.TRAIT_IMPL || fun.getBodyExpression() != null) { - generateMethodHeaderAndBody(fun, jvmSignature, needJetAnnotations, propertyTypeSignature, functionDescriptor, context); + if (kind != OwnerKind.TRAIT_IMPL || hasBodyExpression) { + generateMethodHeaderAndBody(declaration, jvmSignature, needJetAnnotations, propertyTypeSignature, functionDescriptor, context); if (state.getClassBuilderMode() == ClassBuilderMode.FULL && !isAbstract(functionDescriptor, kind)) { generateBridgeIfNeeded(owner, state, v, jvmSignature.getAsmMethod(), functionDescriptor); @@ -109,7 +112,7 @@ public class FunctionCodegen extends GenerationStateAware { } private void generateMethodHeaderAndBody( - @NotNull JetDeclarationWithBody fun, + @NotNull PsiElement declaration, @NotNull JvmMethodSignature jvmSignature, boolean needJetAnnotations, @Nullable String propertyTypeSignature, @@ -119,7 +122,7 @@ public class FunctionCodegen extends GenerationStateAware { OwnerKind kind = context.getContextKind(); Method asmMethod = jvmSignature.getAsmMethod(); - MethodVisitor mv = v.newMethod(fun, + MethodVisitor mv = v.newMethod(declaration, getMethodAsmFlags(functionDescriptor, kind), asmMethod.getName(), asmMethod.getDescriptor(), @@ -142,14 +145,14 @@ public class FunctionCodegen extends GenerationStateAware { LocalVariablesInfo localVariablesInfo = generateLocalVariablesInfo(functionDescriptor); - MethodBounds methodBounds = generateMethodBody(mv, fun, functionDescriptor, context, asmMethod, localVariablesInfo); + MethodBounds methodBounds = generateMethodBody(mv, declaration, functionDescriptor, context, asmMethod, localVariablesInfo); Type thisType; ReceiverParameterDescriptor expectedThisObject = functionDescriptor.getExpectedThisObject(); if (expectedThisObject != null) { thisType = typeMapper.mapType(expectedThisObject.getType()); } - else if (fun instanceof JetFunctionLiteralExpression || isLocalFun(bindingContext, functionDescriptor)) { + else if (declaration instanceof JetFunctionLiteralExpression || isLocalFun(bindingContext, functionDescriptor)) { thisType = typeMapper.mapType(context.getThisDescriptor()); } else { @@ -158,13 +161,13 @@ public class FunctionCodegen extends GenerationStateAware { generateLocalVariableTable(typeMapper, mv, functionDescriptor, thisType, localVariablesInfo, methodBounds); - endVisit(mv, null, fun); + endVisit(mv, null, declaration); } @NotNull private MethodBounds generateMethodBody( @NotNull MethodVisitor mv, - @NotNull JetDeclarationWithBody fun, + @NotNull PsiElement funOrProperty, @NotNull FunctionDescriptor functionDescriptor, @NotNull MethodContext context, @NotNull Method asmMethod, @@ -201,10 +204,23 @@ public class FunctionCodegen extends GenerationStateAware { genNotNullAssertionsForParameters(new InstructionAdapter(mv), state, functionDescriptor, frameMap); - ExpressionCodegen codegen = new ExpressionCodegen(mv, frameMap, asmMethod.getReturnType(), context, state); - codegen.returnExpression(fun.getBodyExpression()); + boolean hasBodyExpression = hasBodyExpression(funOrProperty); + if (hasBodyExpression) { + JetDeclarationWithBody fun = (JetDeclarationWithBody)funOrProperty; + ExpressionCodegen codegen = new ExpressionCodegen(mv, frameMap, asmMethod.getReturnType(), context, state); + codegen.returnExpression(fun.getBodyExpression()); - localVariablesInfo.names.addAll(codegen.getLocalVariableNamesForExpression()); + localVariablesInfo.names.addAll(codegen.getLocalVariableNamesForExpression()); + } else { + ///generate default accessor + assert functionDescriptor instanceof PropertyAccessorDescriptor; + PropertyCodegen.generateDefaultAccessor( + (PropertyAccessorDescriptor) functionDescriptor, + new InstructionAdapter(mv), + kind, + typeMapper, + context); + } } Label methodEnd = new Label(); @@ -213,6 +229,12 @@ public class FunctionCodegen extends GenerationStateAware { return new MethodBounds(methodBegin, methodEnd); } + private static boolean hasBodyExpression(PsiElement funOrProperty) { + return (funOrProperty instanceof JetDeclarationWithBody + && ((JetDeclarationWithBody)funOrProperty).getBodyExpression() != null); + } + + public static class MethodBounds { @NotNull private final Label begin; diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java index 315547ff1c6..aa9076361de 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/PropertyCodegen.java @@ -24,14 +24,14 @@ import org.jetbrains.asm4.MethodVisitor; import org.jetbrains.asm4.Type; import org.jetbrains.asm4.commons.InstructionAdapter; import org.jetbrains.jet.codegen.context.CodegenContext; -import org.jetbrains.jet.codegen.signature.JvmMethodSignature; import org.jetbrains.jet.codegen.signature.JvmPropertyAccessorSignature; import org.jetbrains.jet.codegen.signature.kotlin.JetMethodAnnotationWriter; import org.jetbrains.jet.codegen.state.GenerationStateAware; +import org.jetbrains.jet.codegen.state.JetTypeMapper; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; +import org.jetbrains.jet.lang.resolve.DescriptorResolver; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.java.JvmAbi; import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames; @@ -40,9 +40,8 @@ import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; import static org.jetbrains.asm4.Opcodes.*; -import static org.jetbrains.jet.codegen.AsmUtil.*; +import static org.jetbrains.jet.codegen.AsmUtil.getDeprecatedAccessFlag; import static org.jetbrains.jet.codegen.CodegenUtil.*; -import static org.jetbrains.jet.lang.resolve.BindingContextUtils.descriptorToDeclaration; import static org.jetbrains.jet.lang.resolve.DescriptorUtils.isExternallyAccessible; import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE; @@ -72,16 +71,15 @@ public class PropertyCodegen extends GenerationStateAware { if (kind != OwnerKind.TRAIT_IMPL && !(kind instanceof OwnerKind.StaticDelegateKind)) { generateBackingField(p, propertyDescriptor); } - generateGetter(p, propertyDescriptor); - generateSetter(p, propertyDescriptor); + generateGetter(p, propertyDescriptor, p.getGetter()); + generateSetter(p, propertyDescriptor, p.getSetter()); } public void generatePrimaryConstructorProperty(JetParameter p, PropertyDescriptor descriptor) { generateBackingField(p, descriptor); - int accessFlags = getVisibilityAccessFlag(descriptor) | getModalityAccessFlag(descriptor) | getDeprecatedAccessFlag(descriptor); - generateDefaultGetter(descriptor, accessFlags, p); + generateGetter(p, descriptor, null); if (descriptor.isVar()) { - generateDefaultSetter(descriptor, accessFlags, p); + generateSetter(p, descriptor, null); } } @@ -121,107 +119,73 @@ public class PropertyCodegen extends GenerationStateAware { } } - private void generateGetter(JetProperty p, PropertyDescriptor propertyDescriptor) { - JetPropertyAccessor getter = p.getGetter(); - PropertyGetterDescriptor getterDescriptor = propertyDescriptor.getGetter(); - if (getter != null && getter.getBodyExpression() != null) { + private void generateGetter(JetNamedDeclaration p, PropertyDescriptor propertyDescriptor, JetPropertyAccessor getter) { + if (getter != null && getter.getBodyExpression() != null || isExternallyAccessible(propertyDescriptor)) { JvmPropertyAccessorSignature signature = typeMapper.mapGetterSignature(propertyDescriptor, kind); - functionCodegen.generateMethod(getter, signature.getJvmMethodSignature(), true, signature.getPropertyTypeKotlinSignature(), + PropertyGetterDescriptor getterDescriptor = propertyDescriptor.getGetter(); + getterDescriptor = getterDescriptor != null ? getterDescriptor : DescriptorResolver.createDefaultGetter(propertyDescriptor); + functionCodegen.generateMethod(getter != null ? getter : p, + signature.getJvmMethodSignature(), + true, + signature.getPropertyTypeKotlinSignature(), getterDescriptor); } - else if (isExternallyAccessible(propertyDescriptor)) { - int flags = getVisibilityAccessFlag(propertyDescriptor); - flags |= getModalityAccessFlag(propertyDescriptor); - flags |= getterDescriptor == null ? getDeprecatedAccessFlag(propertyDescriptor): getDeprecatedAccessFlag(getterDescriptor); - generateDefaultGetter(propertyDescriptor, flags, p); - } } - private void generateSetter(JetProperty p, PropertyDescriptor propertyDescriptor) { - JetPropertyAccessor setter = p.getSetter(); - if (setter != null && setter.getBodyExpression() != null) { + private void generateSetter(JetNamedDeclaration p, PropertyDescriptor propertyDescriptor, JetPropertyAccessor setter) { + if (setter != null && setter.getBodyExpression() != null + || isExternallyAccessible(propertyDescriptor) && propertyDescriptor.isVar()) { JvmPropertyAccessorSignature signature = typeMapper.mapSetterSignature(propertyDescriptor, kind); - functionCodegen.generateMethod(setter, signature.getJvmMethodSignature(), true, signature.getPropertyTypeKotlinSignature(), - propertyDescriptor.getSetter()); - } - else if (isExternallyAccessible(propertyDescriptor) && propertyDescriptor.isVar()) { PropertySetterDescriptor setterDescriptor = propertyDescriptor.getSetter(); - int flags = getModalityAccessFlag(propertyDescriptor); - if (setterDescriptor == null) { - flags |= getVisibilityAccessFlag(propertyDescriptor); - flags |= getDeprecatedAccessFlag(propertyDescriptor); - } - else { - flags |= getVisibilityAccessFlag(setterDescriptor); - flags |= getDeprecatedAccessFlag(setterDescriptor); - } - generateDefaultSetter(propertyDescriptor, flags, p); + setterDescriptor = setterDescriptor != null ? setterDescriptor : DescriptorResolver.createDefaultSetter(propertyDescriptor); + functionCodegen.generateMethod(setter != null ? setter : p, + signature.getJvmMethodSignature(), + true, + signature.getPropertyTypeKotlinSignature(), + setterDescriptor); } } - private void generateDefaultGetter(PropertyDescriptor propertyDescriptor, int flags, PsiElement origin) { - checkMustGenerateCode(propertyDescriptor); - if (kind == OwnerKind.TRAIT_IMPL) { - return; - } + public static void generateDefaultAccessor( + @NotNull PropertyAccessorDescriptor accessorDescriptor, + @NotNull InstructionAdapter iv, + @NotNull OwnerKind kind, + @NotNull JetTypeMapper typeMapper, + @NotNull CodegenContext context) { - if (kind == OwnerKind.NAMESPACE || kind instanceof OwnerKind.StaticDelegateKind) { - flags |= ACC_STATIC; - } - - PsiElement psiElement = descriptorToDeclaration(bindingContext, propertyDescriptor.getContainingDeclaration()); - boolean isTrait = psiElement instanceof JetClass && ((JetClass) psiElement).isTrait(); - if (isTrait) { - flags |= ACC_ABSTRACT; - } - - JvmPropertyAccessorSignature signature = typeMapper.mapGetterSignature(propertyDescriptor, kind); - JvmMethodSignature jvmMethodSignature = signature.getJvmMethodSignature(); - String descriptor = jvmMethodSignature.getAsmMethod().getDescriptor(); - String getterName = getterName(propertyDescriptor.getName()); - MethodVisitor mv = v.newMethod(origin, flags, getterName, descriptor, jvmMethodSignature.getGenericsSignature(), null); - PropertyGetterDescriptor getter = propertyDescriptor.getGetter(); - generateJetPropertyAnnotation(mv, signature.getPropertyTypeKotlinSignature(), - jvmMethodSignature.getKotlinTypeParameter(), propertyDescriptor, - getter == null - ? propertyDescriptor.getVisibility() - : getter.getVisibility()); - - if (getter != null) { - //noinspection ConstantConditions - assert !getter.hasBody(); - AnnotationCodegen.forMethod(mv, typeMapper).genAnnotations(getter); - } - - if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && !isTrait) { - if (propertyDescriptor.getModality() != Modality.ABSTRACT) { - mv.visitCode(); - if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { - genStubThrow(mv); - } - else if (kind instanceof OwnerKind.StaticDelegateKind) { - FunctionCodegen.generateStaticDelegateMethodBody(mv, jvmMethodSignature.getAsmMethod(), (OwnerKind.StaticDelegateKind) kind); - } - else { - InstructionAdapter iv = new InstructionAdapter(mv); - if (kind != OwnerKind.NAMESPACE) { - iv.load(0, OBJECT_TYPE); - } - Type type = typeMapper.mapType(propertyDescriptor); - - iv.visitFieldInsn( - kind == OwnerKind.NAMESPACE ? GETSTATIC : GETFIELD, - typeMapper.getOwner(propertyDescriptor, kind, isCallInsideSameModuleAsDeclared(propertyDescriptor, context)).getInternalName(), - propertyDescriptor.getName().getName(), - type.getDescriptor()); - iv.areturn(type); - } + PropertyDescriptor propertyDescriptor = accessorDescriptor.getCorrespondingProperty(); + final Type type = typeMapper.mapType(propertyDescriptor); + if (accessorDescriptor instanceof PropertyGetterDescriptor) { + if (kind != OwnerKind.NAMESPACE) { + iv.load(0, OBJECT_TYPE); } - } - FunctionCodegen.endVisit(mv, "getter", origin); + iv.visitFieldInsn( + kind == OwnerKind.NAMESPACE ? GETSTATIC : GETFIELD, + typeMapper.getOwner(propertyDescriptor, kind, isCallInsideSameModuleAsDeclared(propertyDescriptor, context)).getInternalName(), + propertyDescriptor.getName().getName(), + type.getDescriptor()); + iv.areturn(type); + } else if (accessorDescriptor instanceof PropertySetterDescriptor) { + int paramCode = 0; + if (kind != OwnerKind.NAMESPACE) { + iv.load(0, OBJECT_TYPE); + paramCode = 1; + } + ReceiverParameterDescriptor receiverParameter = propertyDescriptor.getReceiverParameter(); + if (receiverParameter != null) { + paramCode += typeMapper.mapType(receiverParameter.getType()).getSize(); + } + iv.load(paramCode, type); + iv.visitFieldInsn(kind == OwnerKind.NAMESPACE ? PUTSTATIC : PUTFIELD, + typeMapper.getOwner(propertyDescriptor, kind, isCallInsideSameModuleAsDeclared(propertyDescriptor, context)).getInternalName(), + propertyDescriptor.getName().getName(), + type.getDescriptor()); - FunctionCodegen.generateBridgeIfNeeded(context, state, v, jvmMethodSignature.getAsmMethod(), getter); + iv.visitInsn(RETURN); + } else { + assert false; + } } public static void generateJetPropertyAnnotation( @@ -242,73 +206,6 @@ public class PropertyCodegen extends GenerationStateAware { aw.visitEnd(); } - private void generateDefaultSetter(PropertyDescriptor propertyDescriptor, int flags, PsiElement origin) { - checkMustGenerateCode(propertyDescriptor); - - if (kind == OwnerKind.TRAIT_IMPL) { - return; - } - - if (kind == OwnerKind.NAMESPACE || kind instanceof OwnerKind.StaticDelegateKind) { - flags |= ACC_STATIC; - } - - PsiElement psiElement = descriptorToDeclaration(bindingContext, propertyDescriptor.getContainingDeclaration()); - boolean isTrait = psiElement instanceof JetClass && ((JetClass) psiElement).isTrait(); - if (isTrait) { - flags |= ACC_ABSTRACT; - } - - JvmPropertyAccessorSignature signature = typeMapper.mapSetterSignature(propertyDescriptor, kind); - assert true; - JvmMethodSignature jvmMethodSignature = signature.getJvmMethodSignature(); - String descriptor = jvmMethodSignature.getAsmMethod().getDescriptor(); - MethodVisitor mv = v.newMethod(origin, flags, setterName(propertyDescriptor.getName()), descriptor, jvmMethodSignature.getGenericsSignature(), null); - PropertySetterDescriptor setter = propertyDescriptor.getSetter(); - assert setter != null; - generateJetPropertyAnnotation(mv, signature.getPropertyTypeKotlinSignature(), - jvmMethodSignature.getKotlinTypeParameter(), propertyDescriptor, - setter.getVisibility()); - - assert !setter.hasBody(); - AnnotationCodegen.forMethod(mv, typeMapper).genAnnotations(setter); - - if (state.getClassBuilderMode() != ClassBuilderMode.SIGNATURES && (!isTrait)) { - if (propertyDescriptor.getModality() != Modality.ABSTRACT) { - mv.visitCode(); - if (state.getClassBuilderMode() == ClassBuilderMode.STUBS) { - genStubThrow(mv); - } - else if (kind instanceof OwnerKind.StaticDelegateKind) { - FunctionCodegen.generateStaticDelegateMethodBody(mv, jvmMethodSignature.getAsmMethod(), (OwnerKind.StaticDelegateKind) kind); - } - else { - InstructionAdapter iv = new InstructionAdapter(mv); - Type type = typeMapper.mapType(propertyDescriptor); - int paramCode = 0; - if (kind != OwnerKind.NAMESPACE) { - iv.load(0, OBJECT_TYPE); - paramCode = 1; - } - ReceiverParameterDescriptor receiverParameter = propertyDescriptor.getReceiverParameter(); - if (receiverParameter != null) { - paramCode += typeMapper.mapType(receiverParameter.getType()).getSize(); - } - iv.load(paramCode, type); - iv.visitFieldInsn(kind == OwnerKind.NAMESPACE ? PUTSTATIC : PUTFIELD, - typeMapper.getOwner(propertyDescriptor, kind, isCallInsideSameModuleAsDeclared(propertyDescriptor, context)).getInternalName(), - propertyDescriptor.getName().getName(), - type.getDescriptor()); - - iv.visitInsn(RETURN); - } - } - FunctionCodegen.endVisit(mv, "setter", origin); - - FunctionCodegen.generateBridgeIfNeeded(context, state, v, jvmMethodSignature.getAsmMethod(), setter); - } - } - public static String getterName(Name propertyName) { return JvmAbi.GETTER_PREFIX + StringUtil.capitalizeWithJavaBeanConvention(propertyName.getName()); } diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt new file mode 100644 index 00000000000..55dec21fc08 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt @@ -0,0 +1,13 @@ +package test + +class ClassVal() { + val property1 = 1 + + internal val property2 = 1 + + private val property3 = Object() + + protected val property4: String = "" + + public val property5: Int = 1 +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.txt new file mode 100644 index 00000000000..ac68db0f04d --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.txt @@ -0,0 +1,15 @@ +package test + +internal final class ClassVal { + /*primary*/ public constructor ClassVal() + internal final val property1 : jet.Int + internal final fun () : jet.Int + internal final val property2 : jet.Int + internal final fun () : jet.Int + private final val property3 : java.lang.Object + private final fun () : java.lang.Object + protected final val property4 : jet.String + protected final fun () : jet.String + public final val property5 : jet.Int + public final fun () : jet.Int +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt new file mode 100644 index 00000000000..27dd479ba72 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt @@ -0,0 +1,11 @@ +package test + +class ClassValParams( + val pr1: String, + internal val pr2 : Int, + private val pr3: Long, + protected val pr4: java.util.Date, + public val pr5 : Any, + pr6: Object) { +} + diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.txt new file mode 100644 index 00000000000..3078c65e2ec --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.txt @@ -0,0 +1,15 @@ +package test + +internal final class ClassValParams { + /*primary*/ public constructor ClassValParams(/*0*/ pr1 : jet.String, /*1*/ pr2 : jet.Int, /*2*/ pr3 : jet.Long, /*3*/ pr4 : java.util.Date, /*4*/ pr5 : jet.Any, /*5*/ pr6 : java.lang.Object) + internal final val pr1 : jet.String + internal final fun () : jet.String + internal final val pr2 : jet.Int + internal final fun () : jet.Int + private final val pr3 : jet.Long + private final fun () : jet.Long + protected final val pr4 : java.util.Date + protected final fun () : java.util.Date + public final val pr5 : jet.Any + public final fun () : jet.Any +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt new file mode 100644 index 00000000000..823f4320d89 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt @@ -0,0 +1,20 @@ +package test + +class ClassVal() { + val property1 = 1 + get + + internal val property2 = 1 + get + + private val property3 = Object() + get + + protected val property4: String = "" + get + + public val property5: Int = 1 + get +} + + diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.txt new file mode 100644 index 00000000000..ac68db0f04d --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.txt @@ -0,0 +1,15 @@ +package test + +internal final class ClassVal { + /*primary*/ public constructor ClassVal() + internal final val property1 : jet.Int + internal final fun () : jet.Int + internal final val property2 : jet.Int + internal final fun () : jet.Int + private final val property3 : java.lang.Object + private final fun () : java.lang.Object + protected final val property4 : jet.String + protected final fun () : jet.String + public final val property5 : jet.Int + public final fun () : jet.Int +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt new file mode 100644 index 00000000000..30c9606cc6f --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt @@ -0,0 +1,15 @@ +package test + +class ClassVar() { + var property1 = 1 + + internal var property2 = 1 + + private var property3 = Object() + + protected var property4: String = "" + + public var property5: Int = 1 +} + + diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.txt new file mode 100644 index 00000000000..01c5d05b6ea --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.txt @@ -0,0 +1,20 @@ +package test + +internal final class ClassVar { + /*primary*/ public constructor ClassVar() + internal final var property1 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + internal final var property2 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + private final var property3 : java.lang.Object + private final fun () : java.lang.Object + private final fun (/*0*/ : java.lang.Object) : Unit + protected final var property4 : jet.String + protected final fun () : jet.String + protected final fun (/*0*/ : jet.String) : Unit + public final var property5 : jet.Int + public final fun () : jet.Int + public final fun (/*0*/ : jet.Int) : Unit +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt new file mode 100644 index 00000000000..49984a9079e --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt @@ -0,0 +1,18 @@ +package test + +open class ClassVarModality() { + open var property1 = 1 + + final internal var property2 = 1 + + open var property3 = 1 + private set + + final internal var property4 = 1 + private set +} + +abstract class ClassVarModalityAbstract { + abstract var property1 : java.util.Date + public set +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.txt new file mode 100644 index 00000000000..d60cf44835a --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.txt @@ -0,0 +1,24 @@ +package test + +internal open class ClassVarModality { + /*primary*/ public constructor ClassVarModality() + internal open var property1 : jet.Int + internal open fun () : jet.Int + internal open fun (/*0*/ : jet.Int) : Unit + internal final var property2 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + internal open var property3 : jet.Int + internal open fun () : jet.Int + private open fun (/*0*/ : jet.Int) : Unit + internal final var property4 : jet.Int + internal final fun () : jet.Int + private final fun (/*0*/ : jet.Int) : Unit +} + +internal abstract class ClassVarModalityAbstract { + /*primary*/ public constructor ClassVarModalityAbstract() + internal abstract var property1 : java.util.Date + internal abstract fun () : java.util.Date + public abstract fun (/*0*/ : java.util.Date) : Unit +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt new file mode 100644 index 00000000000..57e5623900d --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt @@ -0,0 +1,10 @@ +package test + +class ClassVarParams( + var pr1: String, + internal var pr2 : Int, + private var pr3: Long, + protected var pr4: java.util.Date, + public var pr5 : Any, + pr6: Object) { +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.txt new file mode 100644 index 00000000000..e226dfefcd0 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.txt @@ -0,0 +1,20 @@ +package test + +internal final class ClassVarParams { + /*primary*/ public constructor ClassVarParams(/*0*/ pr1 : jet.String, /*1*/ pr2 : jet.Int, /*2*/ pr3 : jet.Long, /*3*/ pr4 : java.util.Date, /*4*/ pr5 : jet.Any, /*5*/ pr6 : java.lang.Object) + internal final var pr1 : jet.String + internal final fun () : jet.String + internal final fun (/*0*/ : jet.String) : Unit + internal final var pr2 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + private final var pr3 : jet.Long + private final fun () : jet.Long + private final fun (/*0*/ : jet.Long) : Unit + protected final var pr4 : java.util.Date + protected final fun () : java.util.Date + protected final fun (/*0*/ : java.util.Date) : Unit + public final var pr5 : jet.Any + public final fun () : jet.Any + public final fun (/*0*/ : jet.Any) : Unit +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt new file mode 100644 index 00000000000..cfbdf613bf1 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt @@ -0,0 +1,18 @@ +package test + +class ClassVal() { + var property1 = 1 + get + + internal var property2 = 1 + get + + private var property3 = Object() + get + + protected var property4: String = "" + get + + public var property5: Int = 1 + get +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.txt new file mode 100644 index 00000000000..a5d55695dae --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.txt @@ -0,0 +1,20 @@ +package test + +internal final class ClassVal { + /*primary*/ public constructor ClassVal() + internal final var property1 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + internal final var property2 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + private final var property3 : java.lang.Object + private final fun () : java.lang.Object + private final fun (/*0*/ : java.lang.Object) : Unit + protected final var property4 : jet.String + protected final fun () : jet.String + protected final fun (/*0*/ : jet.String) : Unit + public final var property5 : jet.Int + public final fun () : jet.Int + public final fun (/*0*/ : jet.Int) : Unit +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt new file mode 100644 index 00000000000..f68cce922bb --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt @@ -0,0 +1,36 @@ +package test + +class ClassVal() { + var property1 = 1 + set + + var property2 = Object() + protected set + + var property3 = Object() + private set + + protected var property4: String = "" + set + + protected var property5: String = "" + private set + + protected var property6: String = "" + internal set + + protected var property7: java.util.Date = java.util.Date() + public set + + public var property8: Int = 1 + set + + public var property9: Int = 1 + private set + + public var property10: Int = 1 + protected set + + public var property11: Int = 1 + internal set +} \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.txt new file mode 100644 index 00000000000..69a43530bd7 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.txt @@ -0,0 +1,38 @@ +package test + +internal final class ClassVal { + /*primary*/ public constructor ClassVal() + internal final var property1 : jet.Int + internal final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + public final var property10 : jet.Int + public final fun () : jet.Int + protected final fun (/*0*/ : jet.Int) : Unit + public final var property11 : jet.Int + public final fun () : jet.Int + internal final fun (/*0*/ : jet.Int) : Unit + internal final var property2 : java.lang.Object + internal final fun () : java.lang.Object + protected final fun (/*0*/ : java.lang.Object) : Unit + internal final var property3 : java.lang.Object + internal final fun () : java.lang.Object + private final fun (/*0*/ : java.lang.Object) : Unit + protected final var property4 : jet.String + protected final fun () : jet.String + protected final fun (/*0*/ : jet.String) : Unit + protected final var property5 : jet.String + protected final fun () : jet.String + private final fun (/*0*/ : jet.String) : Unit + protected final var property6 : jet.String + protected final fun () : jet.String + internal final fun (/*0*/ : jet.String) : Unit + protected final var property7 : java.util.Date + protected final fun () : java.util.Date + public final fun (/*0*/ : java.util.Date) : Unit + public final var property8 : jet.Int + public final fun () : jet.Int + public final fun (/*0*/ : jet.Int) : Unit + public final var property9 : jet.Int + public final fun () : jet.Int + private final fun (/*0*/ : jet.Int) : Unit +} diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt new file mode 100644 index 00000000000..0a130534231 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt @@ -0,0 +1,9 @@ +package test + +val Long.date1: Object = java.util.Date() + +internal val Long.date12: Object = java.util.Date() + +private val Long.date3: java.util.Date = java.util.Date() + +public val Long.date4: java.util.Date = java.util.Date() \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.txt new file mode 100644 index 00000000000..b31dab5a0f0 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.txt @@ -0,0 +1,10 @@ +package test + +internal val jet.Long.date1 : java.lang.Object + internal fun jet.Long.() : java.lang.Object +internal val jet.Long.date12 : java.lang.Object + internal fun jet.Long.() : java.lang.Object +private val jet.Long.date3 : java.util.Date + private fun jet.Long.() : java.util.Date +public val jet.Long.date4 : java.util.Date + public fun jet.Long.() : java.util.Date diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt new file mode 100644 index 00000000000..e0bdd4eb816 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt @@ -0,0 +1,9 @@ +package test + +var Long.date1: Object = java.util.Date() + +internal var Long.date12: Object = java.util.Date() + +private var Long.date3: java.util.Date = java.util.Date() + +public var Long.date5: java.util.Date = java.util.Date() \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.txt new file mode 100644 index 00000000000..d6201e691c2 --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.txt @@ -0,0 +1,14 @@ +package test + +internal var jet.Long.date1 : java.lang.Object + internal fun jet.Long.() : java.lang.Object + internal fun jet.Long.(/*0*/ : java.lang.Object) : Unit +internal var jet.Long.date12 : java.lang.Object + internal fun jet.Long.() : java.lang.Object + internal fun jet.Long.(/*0*/ : java.lang.Object) : Unit +private var jet.Long.date3 : java.util.Date + private fun jet.Long.() : java.util.Date + private fun jet.Long.(/*0*/ : java.util.Date) : Unit +public var jet.Long.date5 : java.util.Date + public fun jet.Long.() : java.util.Date + public fun jet.Long.(/*0*/ : java.util.Date) : Unit diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt new file mode 100644 index 00000000000..ddf07e1616a --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt @@ -0,0 +1,28 @@ +package test + +var Long.date1: Object = java.util.Date() + set + +var Long.date2: Object = java.util.Date() + protected set + +var Long.date3: Object = java.util.Date() + private set + +private var Long.date4: java.util.Date = java.util.Date() + set + +public var Long.date7: java.util.Date = java.util.Date() + set + +public var Long.date8: java.util.Date = java.util.Date() + internal set + +public var Long.date9: java.util.Date = java.util.Date() + private set + +public var Long.date10: java.util.Date = java.util.Date() + protected set + +public var Long.date11: java.util.Date = java.util.Date() + public set \ No newline at end of file diff --git a/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.txt b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.txt new file mode 100644 index 00000000000..0c8f3a45afa --- /dev/null +++ b/compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.txt @@ -0,0 +1,29 @@ +package test + +internal var jet.Long.date1 : java.lang.Object + internal fun jet.Long.() : java.lang.Object + internal fun jet.Long.(/*0*/ : java.lang.Object) : Unit +public var jet.Long.date10 : java.util.Date + public fun jet.Long.() : java.util.Date + protected fun jet.Long.(/*0*/ : java.util.Date) : Unit +public var jet.Long.date11 : java.util.Date + public fun jet.Long.() : java.util.Date + public fun jet.Long.(/*0*/ : java.util.Date) : Unit +internal var jet.Long.date2 : java.lang.Object + internal fun jet.Long.() : java.lang.Object + protected fun jet.Long.(/*0*/ : java.lang.Object) : Unit +internal var jet.Long.date3 : java.lang.Object + internal fun jet.Long.() : java.lang.Object + private fun jet.Long.(/*0*/ : java.lang.Object) : Unit +private var jet.Long.date4 : java.util.Date + private fun jet.Long.() : java.util.Date + private fun jet.Long.(/*0*/ : java.util.Date) : Unit +public var jet.Long.date7 : java.util.Date + public fun jet.Long.() : java.util.Date + public fun jet.Long.(/*0*/ : java.util.Date) : Unit +public var jet.Long.date8 : java.util.Date + public fun jet.Long.() : java.util.Date + internal fun jet.Long.(/*0*/ : java.util.Date) : Unit +public var jet.Long.date9 : java.util.Date + public fun jet.Long.() : java.util.Date + private fun jet.Long.(/*0*/ : java.util.Date) : Unit diff --git a/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt b/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt index 49a3778204f..974ce4969c1 100644 --- a/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt +++ b/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt @@ -6,4 +6,4 @@ var p: M = throw Exception() // method: _DefaultPackage::setP // jvm signature: (LM;)V // generic signature: (LM<-LX;>;)V -// kotlin signature: null \ No newline at end of file +// kotlin signature: (LM;)null \ No newline at end of file diff --git a/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt b/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt index 424cf8a5d55..b31e57fbc88 100644 --- a/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt +++ b/compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt @@ -6,4 +6,4 @@ var p: M = throw Exception() // method: _DefaultPackage::setP // jvm signature: (LM;)V // generic signature: (LM<+LX;>;)V -// kotlin signature: null +// kotlin signature: (LM;)null diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractLoadCompiledKotlinTest.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractLoadCompiledKotlinTest.java index ecbbbdc34ff..ce0f25443a5 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractLoadCompiledKotlinTest.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/AbstractLoadCompiledKotlinTest.java @@ -36,7 +36,16 @@ import static org.jetbrains.jet.test.util.NamespaceComparator.compareNamespaces; */ @SuppressWarnings("JUnitTestCaseWithNoTests") public abstract class AbstractLoadCompiledKotlinTest extends TestCaseWithTmpdir { + public void doTest(@NotNull String ktFileName) throws Exception { + doTest(ktFileName, false); + } + + public void doTestWithAccessors(@NotNull String ktFileName) throws Exception { + doTest(ktFileName, true); + } + + private void doTest(@NotNull String ktFileName, boolean includeAccessors) throws Exception { File ktFile = new File(ktFileName); File txtFile = new File(ktFileName.replaceFirst("\\.kt$", ".txt")); AnalyzeExhaust exhaust = compileKotlinToDirAndGetAnalyzeExhaust(ktFile, tmpdir, getTestRootDisposable(), @@ -49,6 +58,9 @@ public abstract class AbstractLoadCompiledKotlinTest extends TestCaseWithTmpdir NamespaceDescriptor namespaceFromClass = LoadDescriptorUtil.loadTestNamespaceAndBindingContextFromJavaRoot( tmpdir, getTestRootDisposable(), ConfigurationKind.JDK_ONLY).first; compareNamespaces(namespaceFromSource, namespaceFromClass, - NamespaceComparator.DONT_INCLUDE_METHODS_OF_OBJECT.checkPrimaryConstructors(true), txtFile); + NamespaceComparator.DONT_INCLUDE_METHODS_OF_OBJECT + .checkPrimaryConstructors(true) + .checkPropertyAccessors(includeAccessors), + txtFile); } } diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java index 8d4c85fedb0..7ac9f04378d 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java @@ -45,142 +45,142 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("Class.kt") public void testClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/Class.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/Class.kt"); } @TestMetadata("ClassInParam.kt") public void testClassInParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassInParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassInParam.kt"); } @TestMetadata("ClassInnerClass.kt") public void testClassInnerClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassInnerClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassInnerClass.kt"); } @TestMetadata("ClassOutParam.kt") public void testClassOutParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassOutParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassOutParam.kt"); } @TestMetadata("ClassParam.kt") public void testClassParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParam.kt"); } @TestMetadata("ClassParamReferencesParam.kt") public void testClassParamReferencesParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamReferencesParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesParam.kt"); } @TestMetadata("ClassParamReferencesParam2.kt") public void testClassParamReferencesParam2() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamReferencesParam2.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesParam2.kt"); } @TestMetadata("ClassParamReferencesSelf.kt") public void testClassParamReferencesSelf() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamReferencesSelf.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesSelf.kt"); } @TestMetadata("ClassParamUpperClassBound.kt") public void testClassParamUpperClassBound() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamUpperClassBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamUpperClassBound.kt"); } @TestMetadata("ClassParamUpperClassInterfaceBound.kt") public void testClassParamUpperClassInterfaceBound() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamUpperClassInterfaceBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamUpperClassInterfaceBound.kt"); } @TestMetadata("ClassParamUpperInterfaceBound.kt") public void testClassParamUpperInterfaceBound() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassParamUpperInterfaceBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassParamUpperInterfaceBound.kt"); } @TestMetadata("ClassTwoParams.kt") public void testClassTwoParams() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassTwoParams.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassTwoParams.kt"); } @TestMetadata("ClassTwoParams2.kt") public void testClassTwoParams2() throws Exception { - doTest("compiler/testData/loadKotlin/class/ClassTwoParams2.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/ClassTwoParams2.kt"); } @TestMetadata("EnumWithGenericConstructorParameter.kt") public void testEnumWithGenericConstructorParameter() throws Exception { - doTest("compiler/testData/loadKotlin/class/EnumWithGenericConstructorParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/EnumWithGenericConstructorParameter.kt"); } @TestMetadata("EnumWithPrimitiveConstructorParameter.kt") public void testEnumWithPrimitiveConstructorParameter() throws Exception { - doTest("compiler/testData/loadKotlin/class/EnumWithPrimitiveConstructorParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/EnumWithPrimitiveConstructorParameter.kt"); } @TestMetadata("InheritClassSimple.kt") public void testInheritClassSimple() throws Exception { - doTest("compiler/testData/loadKotlin/class/InheritClassSimple.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/InheritClassSimple.kt"); } @TestMetadata("InheritClassWithParam.kt") public void testInheritClassWithParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); } @TestMetadata("InheritTraitWithParam.kt") public void testInheritTraitWithParam() throws Exception { - doTest("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt"); } @TestMetadata("InnerClassExtendInnerClass.kt") public void testInnerClassExtendInnerClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); } @TestMetadata("InnerGenericClass.kt") public void testInnerGenericClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/InnerGenericClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/InnerGenericClass.kt"); } @TestMetadata("NamedObject.kt") public void testNamedObject() throws Exception { - doTest("compiler/testData/loadKotlin/class/NamedObject.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NamedObject.kt"); } @TestMetadata("NamedObjectInClassObject.kt") public void testNamedObjectInClassObject() throws Exception { - doTest("compiler/testData/loadKotlin/class/NamedObjectInClassObject.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NamedObjectInClassObject.kt"); } @TestMetadata("NamedObjectInNamedObject.kt") public void testNamedObjectInNamedObject() throws Exception { - doTest("compiler/testData/loadKotlin/class/NamedObjectInNamedObject.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NamedObjectInNamedObject.kt"); } @TestMetadata("NamedObjectWithAnotherTopLevelProperty.kt") public void testNamedObjectWithAnotherTopLevelProperty() throws Exception { - doTest("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); } @TestMetadata("NestedClass.kt") public void testNestedClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/NestedClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NestedClass.kt"); } @TestMetadata("NestedClassExtendNestedClass.kt") public void testNestedClassExtendNestedClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/NestedClassExtendNestedClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NestedClassExtendNestedClass.kt"); } @TestMetadata("NestedGenericClass.kt") public void testNestedGenericClass() throws Exception { - doTest("compiler/testData/loadKotlin/class/NestedGenericClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/NestedGenericClass.kt"); } @TestMetadata("Trait.kt") public void testTrait() throws Exception { - doTest("compiler/testData/loadKotlin/class/Trait.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/class/Trait.kt"); } } @@ -193,32 +193,32 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("ClassInParamUsedInFun.kt") public void testClassInParamUsedInFun() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/ClassInParamUsedInFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/ClassInParamUsedInFun.kt"); } @TestMetadata("ClassParamUsedInFun.kt") public void testClassParamUsedInFun() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/ClassParamUsedInFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/ClassParamUsedInFun.kt"); } @TestMetadata("FunDelegationToTraitImpl.kt") public void testFunDelegationToTraitImpl() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/FunDelegationToTraitImpl.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/FunDelegationToTraitImpl.kt"); } @TestMetadata("FunInParamSuper.kt") public void testFunInParamSuper() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/FunInParamSuper.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/FunInParamSuper.kt"); } @TestMetadata("TraitFinalFun.kt") public void testTraitFinalFun() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/TraitFinalFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/TraitFinalFun.kt"); } @TestMetadata("TraitOpenFun.kt") public void testTraitOpenFun() throws Exception { - doTest("compiler/testData/loadKotlin/classFun/TraitOpenFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classFun/TraitOpenFun.kt"); } } @@ -231,27 +231,27 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("ClassObjectDeclaresVal.kt") public void testClassObjectDeclaresVal() throws Exception { - doTest("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVal.kt"); } @TestMetadata("ClassObjectDeclaresVar.kt") public void testClassObjectDeclaresVar() throws Exception { - doTest("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVar.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVar.kt"); } @TestMetadata("ClassObjectExtendsTrait.kt") public void testClassObjectExtendsTrait() throws Exception { - doTest("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTrait.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTrait.kt"); } @TestMetadata("ClassObjectExtendsTraitWithTP.kt") public void testClassObjectExtendsTraitWithTP() throws Exception { - doTest("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt"); } @TestMetadata("SimpleClassObject.kt") public void testSimpleClassObject() throws Exception { - doTest("compiler/testData/loadKotlin/classObject/SimpleClassObject.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/classObject/SimpleClassObject.kt"); } } @@ -265,67 +265,67 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("Constructor0.kt") public void testConstructor0() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/Constructor0.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/Constructor0.kt"); } @TestMetadata("Constructor1.kt") public void testConstructor1() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/Constructor1.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/Constructor1.kt"); } @TestMetadata("Constructor1WithParamDefaultValue.kt") public void testConstructor1WithParamDefaultValue() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/Constructor1WithParamDefaultValue.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/Constructor1WithParamDefaultValue.kt"); } @TestMetadata("Constructor2WithOneParamDefaultValue.kt") public void testConstructor2WithOneParamDefaultValue() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/Constructor2WithOneParamDefaultValue.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/Constructor2WithOneParamDefaultValue.kt"); } @TestMetadata("ConstructorCollectionParameter.kt") public void testConstructorCollectionParameter() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorCollectionParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorCollectionParameter.kt"); } @TestMetadata("ConstructorWithTwoDefArgs.kt") public void testConstructorWithTwoDefArgs() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoDefArgs.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoDefArgs.kt"); } @TestMetadata("ConstructorWithTwoTypeParameters.kt") public void testConstructorWithTwoTypeParameters() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParameters.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParameters.kt"); } @TestMetadata("ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt") public void testConstructorWithTwoTypeParametersAndOneIntValueParameter() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt"); } @TestMetadata("ConstructorWithTwoTypeParametersAndOnePValueParameter.kt") public void testConstructorWithTwoTypeParametersAndOnePValueParameter() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOnePValueParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOnePValueParameter.kt"); } @TestMetadata("ConstructorWithTypeParameter.kt") public void testConstructorWithTypeParameter() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParameter.kt"); } @TestMetadata("ConstructorWithTypeParametersEAndOnePValueParameter.kt") public void testConstructorWithTypeParametersEAndOnePValueParameter() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParametersEAndOnePValueParameter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParametersEAndOnePValueParameter.kt"); } @TestMetadata("InnerClassConstructorWithDefArgs.kt") public void testInnerClassConstructorWithDefArgs() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/InnerClassConstructorWithDefArgs.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/InnerClassConstructorWithDefArgs.kt"); } @TestMetadata("PrivateConstructor1WithParamDefaultValue.kt") public void testPrivateConstructor1WithParamDefaultValue() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/PrivateConstructor1WithParamDefaultValue.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/PrivateConstructor1WithParamDefaultValue.kt"); } @TestMetadata("compiler/testData/loadKotlin/constructor/vararg") @@ -336,12 +336,12 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("ConstructorNonLastVararg.kt") public void testConstructorNonLastVararg() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/vararg/ConstructorNonLastVararg.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/vararg/ConstructorNonLastVararg.kt"); } @TestMetadata("ConstructorVararg.kt") public void testConstructorVararg() throws Exception { - doTest("compiler/testData/loadKotlin/constructor/vararg/ConstructorVararg.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/constructor/vararg/ConstructorVararg.kt"); } } @@ -362,37 +362,37 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("MixedComponents.kt") public void testMixedComponents() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/MixedComponents.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/MixedComponents.kt"); } @TestMetadata("NoComponents.kt") public void testNoComponents() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/NoComponents.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/NoComponents.kt"); } @TestMetadata("OneVal.kt") public void testOneVal() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/OneVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/OneVal.kt"); } @TestMetadata("OpenDataClass.kt") public void testOpenDataClass() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/OpenDataClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/OpenDataClass.kt"); } @TestMetadata("OpenPropertyFinalComponent.kt") public void testOpenPropertyFinalComponent() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/OpenPropertyFinalComponent.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/OpenPropertyFinalComponent.kt"); } @TestMetadata("TwoVals.kt") public void testTwoVals() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/TwoVals.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/TwoVals.kt"); } @TestMetadata("TwoVars.kt") public void testTwoVars() throws Exception { - doTest("compiler/testData/loadKotlin/dataClass/TwoVars.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/dataClass/TwoVars.kt"); } } @@ -406,7 +406,7 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("PropagateSubclassOfComparable.kt") public void testPropagateSubclassOfComparable() throws Exception { - doTest("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt"); } @TestMetadata("compiler/testData/loadKotlin/fun/genericWithTypeVariables") @@ -417,52 +417,52 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("FunGenericParam.kt") public void testFunGenericParam() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunGenericParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunGenericParam.kt"); } @TestMetadata("FunParamParam.kt") public void testFunParamParam() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParam.kt"); } @TestMetadata("FunParamParamErased.kt") public void testFunParamParamErased() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParamErased.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParamErased.kt"); } @TestMetadata("FunParamReferencesParam.kt") public void testFunParamReferencesParam() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamReferencesParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamReferencesParam.kt"); } @TestMetadata("FunParamTwoUpperBounds.kt") public void testFunParamTwoUpperBounds() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt"); } @TestMetadata("FunParamUpperClassBound.kt") public void testFunParamUpperClassBound() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassBound.kt"); } @TestMetadata("FunParamUpperClassInterfaceBound.kt") public void testFunParamUpperClassInterfaceBound() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassInterfaceBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassInterfaceBound.kt"); } @TestMetadata("FunParamUpperInterfaceBound.kt") public void testFunParamUpperInterfaceBound() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperInterfaceBound.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperInterfaceBound.kt"); } @TestMetadata("FunParamVaragParam.kt") public void testFunParamVaragParam() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamVaragParam.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamVaragParam.kt"); } @TestMetadata("FunTwoTypeParams.kt") public void testFunTwoTypeParams() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunTwoTypeParams.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunTwoTypeParams.kt"); } } @@ -475,27 +475,27 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("FunClassParamNotNull.kt") public void testFunClassParamNotNull() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt"); } @TestMetadata("FunClassParamNullable.kt") public void testFunClassParamNullable() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNullable.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNullable.kt"); } @TestMetadata("FunParamNullable.kt") public void testFunParamNullable() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunParamNullable.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunParamNullable.kt"); } @TestMetadata("ReturnTypeClassParamNotNull.kt") public void testReturnTypeClassParamNotNull() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt"); } @TestMetadata("ReturnTypeClassParamNullable.kt") public void testReturnTypeClassParamNullable() throws Exception { - doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt"); } } @@ -508,82 +508,82 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("ClassFun.kt") public void testClassFun() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFun.kt"); } @TestMetadata("ClassFunGetFoo.kt") public void testClassFunGetFoo() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFoo.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFoo.kt"); } @TestMetadata("ClassFunGetFooSetFoo.kt") public void testClassFunGetFooSetFoo() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFooSetFoo.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFooSetFoo.kt"); } @TestMetadata("ClassFunSetFoo.kt") public void testClassFunSetFoo() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunSetFoo.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunSetFoo.kt"); } @TestMetadata("ExtFun.kt") public void testExtFun() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ExtFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFun.kt"); } @TestMetadata("ExtFunInClass.kt") public void testExtFunInClass() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ExtFunInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFunInClass.kt"); } @TestMetadata("FunDefaultArg.kt") public void testFunDefaultArg() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunDefaultArg.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunDefaultArg.kt"); } @TestMetadata("FunParamNotNull.kt") public void testFunParamNotNull() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunParamNotNull.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunParamNotNull.kt"); } @TestMetadata("FunVarargInt.kt") public void testFunVarargInt() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInt.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInt.kt"); } @TestMetadata("FunVarargInteger.kt") public void testFunVarargInteger() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInteger.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInteger.kt"); } @TestMetadata("ModifierAbstract.kt") public void testModifierAbstract() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ModifierAbstract.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierAbstract.kt"); } @TestMetadata("ModifierOpen.kt") public void testModifierOpen() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ModifierOpen.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierOpen.kt"); } @TestMetadata("NsFun.kt") public void testNsFun() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/NsFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/NsFun.kt"); } @TestMetadata("NsFunGetFoo.kt") public void testNsFunGetFoo() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/NsFunGetFoo.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/NsFunGetFoo.kt"); } @TestMetadata("ReturnTypeNotNull.kt") public void testReturnTypeNotNull() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNotNull.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNotNull.kt"); } @TestMetadata("ReturnTypeNullable.kt") public void testReturnTypeNullable() throws Exception { - doTest("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNullable.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNullable.kt"); } } @@ -596,7 +596,7 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("nonLastVararg.kt") public void testNonLastVararg() throws Exception { - doTest("compiler/testData/loadKotlin/fun/vararg/nonLastVararg.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/fun/vararg/nonLastVararg.kt"); } } @@ -613,6 +613,7 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT } @TestMetadata("compiler/testData/loadKotlin/prop") + @InnerTestClasses({Prop.DefaultAccessors.class}) public static class Prop extends AbstractLoadCompiledKotlinTest { public void testAllFilesPresentInProp() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop"), Pattern.compile("^(.+)\\.kt$"), true); @@ -620,154 +621,223 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("ClassVal.kt") public void testClassVal() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ClassVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ClassVal.kt"); } @TestMetadata("ClassValAbstract.kt") public void testClassValAbstract() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ClassValAbstract.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ClassValAbstract.kt"); } @TestMetadata("ClassVar.kt") public void testClassVar() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ClassVar.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ClassVar.kt"); } @TestMetadata("CollectionSize.kt") public void testCollectionSize() throws Exception { - doTest("compiler/testData/loadKotlin/prop/CollectionSize.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/CollectionSize.kt"); } @TestMetadata("ExtValClass.kt") public void testExtValClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValClass.kt"); } @TestMetadata("ExtValInClass.kt") public void testExtValInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValInClass.kt"); } @TestMetadata("ExtValInt.kt") public void testExtValInt() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValInt.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValInt.kt"); } @TestMetadata("ExtValIntCharSequence.kt") public void testExtValIntCharSequence() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValIntCharSequence.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValIntCharSequence.kt"); } @TestMetadata("ExtValIntCharSequenceQ.kt") public void testExtValIntCharSequenceQ() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValIntCharSequenceQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValIntCharSequenceQ.kt"); } @TestMetadata("ExtValIntListQOfIntInClass.kt") public void testExtValIntListQOfIntInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValIntListQOfIntInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValIntListQOfIntInClass.kt"); } @TestMetadata("ExtValIntTInClass.kt") public void testExtValIntTInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValIntTInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValIntTInClass.kt"); } @TestMetadata("ExtValIntTQInClass.kt") public void testExtValIntTQInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValIntTQInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValIntTQInClass.kt"); } @TestMetadata("ExtValTIntInClass.kt") public void testExtValTIntInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtValTIntInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtValTIntInClass.kt"); } @TestMetadata("ExtVarClass.kt") public void testExtVarClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarClass.kt"); } @TestMetadata("ExtVarInClass.kt") public void testExtVarInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarInClass.kt"); } @TestMetadata("ExtVarInt.kt") public void testExtVarInt() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarInt.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarInt.kt"); } @TestMetadata("ExtVarIntTInClass.kt") public void testExtVarIntTInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarIntTInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarIntTInClass.kt"); } @TestMetadata("ExtVarIntTQInClass.kt") public void testExtVarIntTQInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarIntTQInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarIntTQInClass.kt"); } @TestMetadata("ExtVarMapPQInt.kt") public void testExtVarMapPQInt() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarMapPQInt.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarMapPQInt.kt"); } @TestMetadata("ExtVarTIntInClass.kt") public void testExtVarTIntInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarTIntInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarTIntInClass.kt"); } @TestMetadata("ExtVarTQIntInClass.kt") public void testExtVarTQIntInClass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarTQIntInClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarTQIntInClass.kt"); } @TestMetadata("ExtVarl.kt") public void testExtVarl() throws Exception { - doTest("compiler/testData/loadKotlin/prop/ExtVarl.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/ExtVarl.kt"); } @TestMetadata("NsVal.kt") public void testNsVal() throws Exception { - doTest("compiler/testData/loadKotlin/prop/NsVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/NsVal.kt"); } @TestMetadata("NsVar.kt") public void testNsVar() throws Exception { - doTest("compiler/testData/loadKotlin/prop/NsVar.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/NsVar.kt"); } @TestMetadata("OverrideClassVal.kt") public void testOverrideClassVal() throws Exception { - doTest("compiler/testData/loadKotlin/prop/OverrideClassVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/OverrideClassVal.kt"); } @TestMetadata("OverrideTraitVal.kt") public void testOverrideTraitVal() throws Exception { - doTest("compiler/testData/loadKotlin/prop/OverrideTraitVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/OverrideTraitVal.kt"); } @TestMetadata("PropFromSuperclass.kt") public void testPropFromSuperclass() throws Exception { - doTest("compiler/testData/loadKotlin/prop/PropFromSuperclass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/PropFromSuperclass.kt"); } @TestMetadata("TraitFinalVar.kt") public void testTraitFinalVar() throws Exception { - doTest("compiler/testData/loadKotlin/prop/TraitFinalVar.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/TraitFinalVar.kt"); } @TestMetadata("TraitOpenVal.kt") public void testTraitOpenVal() throws Exception { - doTest("compiler/testData/loadKotlin/prop/TraitOpenVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/TraitOpenVal.kt"); } @TestMetadata("VarDelegationToTraitImpl.kt") public void testVarDelegationToTraitImpl() throws Exception { - doTest("compiler/testData/loadKotlin/prop/VarDelegationToTraitImpl.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/prop/VarDelegationToTraitImpl.kt"); } + @TestMetadata("compiler/testData/loadKotlin/prop/defaultAccessors") + public static class DefaultAccessors extends AbstractLoadCompiledKotlinTest { + public void testAllFilesPresentInDefaultAccessors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop/defaultAccessors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassVal.kt") + public void testClassVal() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt"); + } + + @TestMetadata("ClassValParams.kt") + public void testClassValParams() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt"); + } + + @TestMetadata("ClassValWithGet.kt") + public void testClassValWithGet() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt"); + } + + @TestMetadata("ClassVar.kt") + public void testClassVar() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt"); + } + + @TestMetadata("ClassVarModality.kt") + public void testClassVarModality() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt"); + } + + @TestMetadata("ClassVarParams.kt") + public void testClassVarParams() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt"); + } + + @TestMetadata("ClassVarWithGet.kt") + public void testClassVarWithGet() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt"); + } + + @TestMetadata("ClassVarWithSet.kt") + public void testClassVarWithSet() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt"); + } + + @TestMetadata("ExtValLong.kt") + public void testExtValLong() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt"); + } + + @TestMetadata("ExtVarLong.kt") + public void testExtVarLong() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt"); + } + + @TestMetadata("ExtVarLongWithSet.kt") + public void testExtVarLongWithSet() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Prop"); + suite.addTestSuite(Prop.class); + suite.addTestSuite(DefaultAccessors.class); + return suite; + } } @TestMetadata("compiler/testData/loadKotlin/type") @@ -778,147 +848,147 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("Any.kt") public void testAny() throws Exception { - doTest("compiler/testData/loadKotlin/type/Any.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/Any.kt"); } @TestMetadata("AnyQ.kt") public void testAnyQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/AnyQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/AnyQ.kt"); } @TestMetadata("ArrayOfInNumber.kt") public void testArrayOfInNumber() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfInNumber.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfInNumber.kt"); } @TestMetadata("ArrayOfInt.kt") public void testArrayOfInt() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfInt.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfInt.kt"); } @TestMetadata("ArrayOfInteger.kt") public void testArrayOfInteger() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfInteger.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfInteger.kt"); } @TestMetadata("ArrayOfOutNumber.kt") public void testArrayOfOutNumber() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfOutNumber.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfOutNumber.kt"); } @TestMetadata("ArrayOfOutT.kt") public void testArrayOfOutT() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfOutT.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfOutT.kt"); } @TestMetadata("ArrayOfString.kt") public void testArrayOfString() throws Exception { - doTest("compiler/testData/loadKotlin/type/ArrayOfString.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ArrayOfString.kt"); } @TestMetadata("Function1IntString.kt") public void testFunction1IntString() throws Exception { - doTest("compiler/testData/loadKotlin/type/Function1IntString.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/Function1IntString.kt"); } @TestMetadata("Int.kt") public void testInt() throws Exception { - doTest("compiler/testData/loadKotlin/type/Int.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/Int.kt"); } @TestMetadata("IntArray.kt") public void testIntArray() throws Exception { - doTest("compiler/testData/loadKotlin/type/IntArray.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/IntArray.kt"); } @TestMetadata("IntQ.kt") public void testIntQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/IntQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/IntQ.kt"); } @TestMetadata("jlInteger.kt") public void testJlInteger() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlInteger.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlInteger.kt"); } @TestMetadata("jlIntegerQ.kt") public void testJlIntegerQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlIntegerQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlIntegerQ.kt"); } @TestMetadata("jlNumber.kt") public void testJlNumber() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlNumber.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlNumber.kt"); } @TestMetadata("jlObject.kt") public void testJlObject() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlObject.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlObject.kt"); } @TestMetadata("jlObjectQ.kt") public void testJlObjectQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlObjectQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlObjectQ.kt"); } @TestMetadata("jlString.kt") public void testJlString() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlString.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlString.kt"); } @TestMetadata("jlStringQ.kt") public void testJlStringQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/jlStringQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/jlStringQ.kt"); } @TestMetadata("ListOfAny.kt") public void testListOfAny() throws Exception { - doTest("compiler/testData/loadKotlin/type/ListOfAny.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ListOfAny.kt"); } @TestMetadata("ListOfAnyQ.kt") public void testListOfAnyQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/ListOfAnyQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ListOfAnyQ.kt"); } @TestMetadata("ListOfStar.kt") public void testListOfStar() throws Exception { - doTest("compiler/testData/loadKotlin/type/ListOfStar.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ListOfStar.kt"); } @TestMetadata("ListOfString.kt") public void testListOfString() throws Exception { - doTest("compiler/testData/loadKotlin/type/ListOfString.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ListOfString.kt"); } @TestMetadata("ListOfjlString.kt") public void testListOfjlString() throws Exception { - doTest("compiler/testData/loadKotlin/type/ListOfjlString.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/ListOfjlString.kt"); } @TestMetadata("Nothing.kt") public void testNothing() throws Exception { - doTest("compiler/testData/loadKotlin/type/Nothing.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/Nothing.kt"); } @TestMetadata("NothingQ.kt") public void testNothingQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/NothingQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/NothingQ.kt"); } @TestMetadata("String.kt") public void testString() throws Exception { - doTest("compiler/testData/loadKotlin/type/String.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/String.kt"); } @TestMetadata("StringQ.kt") public void testStringQ() throws Exception { - doTest("compiler/testData/loadKotlin/type/StringQ.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/StringQ.kt"); } @TestMetadata("Tuple0.kt") public void testTuple0() throws Exception { - doTest("compiler/testData/loadKotlin/type/Tuple0.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/type/Tuple0.kt"); } } @@ -931,52 +1001,52 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT @TestMetadata("InternalAbstractTraitMembersOverridden.kt") public void testInternalAbstractTraitMembersOverridden() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); } @TestMetadata("InternalClass.kt") public void testInternalClass() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalClass.kt"); } @TestMetadata("InternalConstructor.kt") public void testInternalConstructor() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalConstructor.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalConstructor.kt"); } @TestMetadata("InternalTopLevelMembers.kt") public void testInternalTopLevelMembers() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalTopLevelMembers.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalTopLevelMembers.kt"); } @TestMetadata("InternalTraitMembers.kt") public void testInternalTraitMembers() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalTraitMembers.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalTraitMembers.kt"); } @TestMetadata("InternalTraitMembersInherited.kt") public void testInternalTraitMembersInherited() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/InternalTraitMembersInherited.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/InternalTraitMembersInherited.kt"); } @TestMetadata("PrivateClass.kt") public void testPrivateClass() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/PrivateClass.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/PrivateClass.kt"); } @TestMetadata("PrivateTopLevelFun.kt") public void testPrivateTopLevelFun() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/PrivateTopLevelFun.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/PrivateTopLevelFun.kt"); } @TestMetadata("PrivateTopLevelVal.kt") public void testPrivateTopLevelVal() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/PrivateTopLevelVal.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/PrivateTopLevelVal.kt"); } @TestMetadata("TopLevelVarWithPrivateSetter.kt") public void testTopLevelVarWithPrivateSetter() throws Exception { - doTest("compiler/testData/loadKotlin/visibility/TopLevelVarWithPrivateSetter.kt"); + doTestWithAccessors("compiler/testData/loadKotlin/visibility/TopLevelVarWithPrivateSetter.kt"); } } @@ -990,7 +1060,7 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT suite.addTest(Constructor.innerSuite()); suite.addTestSuite(DataClass.class); suite.addTest(Fun.innerSuite()); - suite.addTestSuite(Prop.class); + suite.addTest(Prop.innerSuite()); suite.addTestSuite(Type.class); suite.addTestSuite(Visibility.class); return suite; diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveNamespaceComparingTest.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveNamespaceComparingTest.java index 2191235ffb6..86e8a715350 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveNamespaceComparingTest.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveNamespaceComparingTest.java @@ -42,14 +42,18 @@ public abstract class AbstractLazyResolveNamespaceComparingTest extends KotlinTe } protected void doTestCheckingPrimaryConstructors(String testFileName) throws IOException { - doTest(testFileName, true); + doTest(testFileName, true, false); + } + + protected void doTestCheckingPrimaryConstructorsAndAccessors(String testFileName) throws IOException { + doTest(testFileName, true, true); } protected void doTestNotCheckingPrimaryConstructors(String testFileName) throws IOException { - doTest(testFileName, false); + doTest(testFileName, false, false); } - private void doTest(String testFileName, boolean checkPrimaryConstructors) throws IOException { + private void doTest(String testFileName, boolean checkPrimaryConstructors, boolean checkPropertyAccessors) throws IOException { List files = JetTestUtils .createTestFiles(testFileName, FileUtil.loadFile(new File(testFileName), true), new JetTestUtils.TestFileFactory() { @@ -75,6 +79,6 @@ public abstract class AbstractLazyResolveNamespaceComparingTest extends KotlinTe public boolean apply(FqNameUnsafe fqName) { return !KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME.toUnsafe().equals(fqName); } - }).checkPrimaryConstructors(checkPrimaryConstructors), serializeResultsTo); + }).checkPrimaryConstructors(checkPrimaryConstructors).checkPropertyAccessors(checkPropertyAccessors), serializeResultsTo); } } diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java index c8134e41c6d..77c31104d3b 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveNamespaceComparingTestGenerated.java @@ -47,142 +47,142 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("Class.kt") public void testClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/Class.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/Class.kt"); } @TestMetadata("ClassInParam.kt") public void testClassInParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassInParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassInParam.kt"); } @TestMetadata("ClassInnerClass.kt") public void testClassInnerClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassInnerClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassInnerClass.kt"); } @TestMetadata("ClassOutParam.kt") public void testClassOutParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassOutParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassOutParam.kt"); } @TestMetadata("ClassParam.kt") public void testClassParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParam.kt"); } @TestMetadata("ClassParamReferencesParam.kt") public void testClassParamReferencesParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamReferencesParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesParam.kt"); } @TestMetadata("ClassParamReferencesParam2.kt") public void testClassParamReferencesParam2() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamReferencesParam2.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesParam2.kt"); } @TestMetadata("ClassParamReferencesSelf.kt") public void testClassParamReferencesSelf() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamReferencesSelf.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamReferencesSelf.kt"); } @TestMetadata("ClassParamUpperClassBound.kt") public void testClassParamUpperClassBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamUpperClassBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamUpperClassBound.kt"); } @TestMetadata("ClassParamUpperClassInterfaceBound.kt") public void testClassParamUpperClassInterfaceBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamUpperClassInterfaceBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamUpperClassInterfaceBound.kt"); } @TestMetadata("ClassParamUpperInterfaceBound.kt") public void testClassParamUpperInterfaceBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassParamUpperInterfaceBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassParamUpperInterfaceBound.kt"); } @TestMetadata("ClassTwoParams.kt") public void testClassTwoParams() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassTwoParams.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassTwoParams.kt"); } @TestMetadata("ClassTwoParams2.kt") public void testClassTwoParams2() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/ClassTwoParams2.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/ClassTwoParams2.kt"); } @TestMetadata("EnumWithGenericConstructorParameter.kt") public void testEnumWithGenericConstructorParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/EnumWithGenericConstructorParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/EnumWithGenericConstructorParameter.kt"); } @TestMetadata("EnumWithPrimitiveConstructorParameter.kt") public void testEnumWithPrimitiveConstructorParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/EnumWithPrimitiveConstructorParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/EnumWithPrimitiveConstructorParameter.kt"); } @TestMetadata("InheritClassSimple.kt") public void testInheritClassSimple() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/InheritClassSimple.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritClassSimple.kt"); } @TestMetadata("InheritClassWithParam.kt") public void testInheritClassWithParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); } @TestMetadata("InheritTraitWithParam.kt") public void testInheritTraitWithParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt"); } @TestMetadata("InnerClassExtendInnerClass.kt") public void testInnerClassExtendInnerClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); } @TestMetadata("InnerGenericClass.kt") public void testInnerGenericClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/InnerGenericClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InnerGenericClass.kt"); } @TestMetadata("NamedObject.kt") public void testNamedObject() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NamedObject.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NamedObject.kt"); } @TestMetadata("NamedObjectInClassObject.kt") public void testNamedObjectInClassObject() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NamedObjectInClassObject.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NamedObjectInClassObject.kt"); } @TestMetadata("NamedObjectInNamedObject.kt") public void testNamedObjectInNamedObject() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NamedObjectInNamedObject.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NamedObjectInNamedObject.kt"); } @TestMetadata("NamedObjectWithAnotherTopLevelProperty.kt") public void testNamedObjectWithAnotherTopLevelProperty() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); } @TestMetadata("NestedClass.kt") public void testNestedClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NestedClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NestedClass.kt"); } @TestMetadata("NestedClassExtendNestedClass.kt") public void testNestedClassExtendNestedClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NestedClassExtendNestedClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NestedClassExtendNestedClass.kt"); } @TestMetadata("NestedGenericClass.kt") public void testNestedGenericClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/NestedGenericClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/NestedGenericClass.kt"); } @TestMetadata("Trait.kt") public void testTrait() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/class/Trait.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/Trait.kt"); } } @@ -195,32 +195,32 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("ClassInParamUsedInFun.kt") public void testClassInParamUsedInFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/ClassInParamUsedInFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/ClassInParamUsedInFun.kt"); } @TestMetadata("ClassParamUsedInFun.kt") public void testClassParamUsedInFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/ClassParamUsedInFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/ClassParamUsedInFun.kt"); } @TestMetadata("FunDelegationToTraitImpl.kt") public void testFunDelegationToTraitImpl() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/FunDelegationToTraitImpl.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/FunDelegationToTraitImpl.kt"); } @TestMetadata("FunInParamSuper.kt") public void testFunInParamSuper() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/FunInParamSuper.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/FunInParamSuper.kt"); } @TestMetadata("TraitFinalFun.kt") public void testTraitFinalFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/TraitFinalFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/TraitFinalFun.kt"); } @TestMetadata("TraitOpenFun.kt") public void testTraitOpenFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classFun/TraitOpenFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classFun/TraitOpenFun.kt"); } } @@ -233,27 +233,27 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("ClassObjectDeclaresVal.kt") public void testClassObjectDeclaresVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVal.kt"); } @TestMetadata("ClassObjectDeclaresVar.kt") public void testClassObjectDeclaresVar() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVar.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVar.kt"); } @TestMetadata("ClassObjectExtendsTrait.kt") public void testClassObjectExtendsTrait() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTrait.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTrait.kt"); } @TestMetadata("ClassObjectExtendsTraitWithTP.kt") public void testClassObjectExtendsTraitWithTP() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt"); } @TestMetadata("SimpleClassObject.kt") public void testSimpleClassObject() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/classObject/SimpleClassObject.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/classObject/SimpleClassObject.kt"); } } @@ -267,67 +267,67 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("Constructor0.kt") public void testConstructor0() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/Constructor0.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/Constructor0.kt"); } @TestMetadata("Constructor1.kt") public void testConstructor1() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/Constructor1.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/Constructor1.kt"); } @TestMetadata("Constructor1WithParamDefaultValue.kt") public void testConstructor1WithParamDefaultValue() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/Constructor1WithParamDefaultValue.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/Constructor1WithParamDefaultValue.kt"); } @TestMetadata("Constructor2WithOneParamDefaultValue.kt") public void testConstructor2WithOneParamDefaultValue() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/Constructor2WithOneParamDefaultValue.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/Constructor2WithOneParamDefaultValue.kt"); } @TestMetadata("ConstructorCollectionParameter.kt") public void testConstructorCollectionParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorCollectionParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorCollectionParameter.kt"); } @TestMetadata("ConstructorWithTwoDefArgs.kt") public void testConstructorWithTwoDefArgs() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoDefArgs.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoDefArgs.kt"); } @TestMetadata("ConstructorWithTwoTypeParameters.kt") public void testConstructorWithTwoTypeParameters() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParameters.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParameters.kt"); } @TestMetadata("ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt") public void testConstructorWithTwoTypeParametersAndOneIntValueParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt"); } @TestMetadata("ConstructorWithTwoTypeParametersAndOnePValueParameter.kt") public void testConstructorWithTwoTypeParametersAndOnePValueParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOnePValueParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOnePValueParameter.kt"); } @TestMetadata("ConstructorWithTypeParameter.kt") public void testConstructorWithTypeParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParameter.kt"); } @TestMetadata("ConstructorWithTypeParametersEAndOnePValueParameter.kt") public void testConstructorWithTypeParametersEAndOnePValueParameter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParametersEAndOnePValueParameter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParametersEAndOnePValueParameter.kt"); } @TestMetadata("InnerClassConstructorWithDefArgs.kt") public void testInnerClassConstructorWithDefArgs() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/InnerClassConstructorWithDefArgs.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/InnerClassConstructorWithDefArgs.kt"); } @TestMetadata("PrivateConstructor1WithParamDefaultValue.kt") public void testPrivateConstructor1WithParamDefaultValue() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/PrivateConstructor1WithParamDefaultValue.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/PrivateConstructor1WithParamDefaultValue.kt"); } @TestMetadata("compiler/testData/loadKotlin/constructor/vararg") @@ -338,12 +338,12 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("ConstructorNonLastVararg.kt") public void testConstructorNonLastVararg() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/vararg/ConstructorNonLastVararg.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/vararg/ConstructorNonLastVararg.kt"); } @TestMetadata("ConstructorVararg.kt") public void testConstructorVararg() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/constructor/vararg/ConstructorVararg.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/constructor/vararg/ConstructorVararg.kt"); } } @@ -364,37 +364,37 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("MixedComponents.kt") public void testMixedComponents() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/MixedComponents.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/MixedComponents.kt"); } @TestMetadata("NoComponents.kt") public void testNoComponents() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/NoComponents.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/NoComponents.kt"); } @TestMetadata("OneVal.kt") public void testOneVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/OneVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/OneVal.kt"); } @TestMetadata("OpenDataClass.kt") public void testOpenDataClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/OpenDataClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/OpenDataClass.kt"); } @TestMetadata("OpenPropertyFinalComponent.kt") public void testOpenPropertyFinalComponent() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/OpenPropertyFinalComponent.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/OpenPropertyFinalComponent.kt"); } @TestMetadata("TwoVals.kt") public void testTwoVals() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/TwoVals.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/TwoVals.kt"); } @TestMetadata("TwoVars.kt") public void testTwoVars() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/dataClass/TwoVars.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/dataClass/TwoVars.kt"); } } @@ -408,7 +408,7 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("PropagateSubclassOfComparable.kt") public void testPropagateSubclassOfComparable() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt"); } @TestMetadata("compiler/testData/loadKotlin/fun/genericWithTypeVariables") @@ -419,52 +419,52 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("FunGenericParam.kt") public void testFunGenericParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunGenericParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunGenericParam.kt"); } @TestMetadata("FunParamParam.kt") public void testFunParamParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParam.kt"); } @TestMetadata("FunParamParamErased.kt") public void testFunParamParamErased() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParamErased.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParamErased.kt"); } @TestMetadata("FunParamReferencesParam.kt") public void testFunParamReferencesParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamReferencesParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamReferencesParam.kt"); } @TestMetadata("FunParamTwoUpperBounds.kt") public void testFunParamTwoUpperBounds() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt"); } @TestMetadata("FunParamUpperClassBound.kt") public void testFunParamUpperClassBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassBound.kt"); } @TestMetadata("FunParamUpperClassInterfaceBound.kt") public void testFunParamUpperClassInterfaceBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassInterfaceBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassInterfaceBound.kt"); } @TestMetadata("FunParamUpperInterfaceBound.kt") public void testFunParamUpperInterfaceBound() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperInterfaceBound.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperInterfaceBound.kt"); } @TestMetadata("FunParamVaragParam.kt") public void testFunParamVaragParam() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamVaragParam.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamVaragParam.kt"); } @TestMetadata("FunTwoTypeParams.kt") public void testFunTwoTypeParams() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunTwoTypeParams.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunTwoTypeParams.kt"); } } @@ -477,27 +477,27 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("FunClassParamNotNull.kt") public void testFunClassParamNotNull() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt"); } @TestMetadata("FunClassParamNullable.kt") public void testFunClassParamNullable() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNullable.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNullable.kt"); } @TestMetadata("FunParamNullable.kt") public void testFunParamNullable() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunParamNullable.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunParamNullable.kt"); } @TestMetadata("ReturnTypeClassParamNotNull.kt") public void testReturnTypeClassParamNotNull() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt"); } @TestMetadata("ReturnTypeClassParamNullable.kt") public void testReturnTypeClassParamNullable() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt"); } } @@ -510,82 +510,82 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("ClassFun.kt") public void testClassFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFun.kt"); } @TestMetadata("ClassFunGetFoo.kt") public void testClassFunGetFoo() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFoo.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFoo.kt"); } @TestMetadata("ClassFunGetFooSetFoo.kt") public void testClassFunGetFooSetFoo() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFooSetFoo.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFooSetFoo.kt"); } @TestMetadata("ClassFunSetFoo.kt") public void testClassFunSetFoo() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunSetFoo.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunSetFoo.kt"); } @TestMetadata("ExtFun.kt") public void testExtFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFun.kt"); } @TestMetadata("ExtFunInClass.kt") public void testExtFunInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFunInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ExtFunInClass.kt"); } @TestMetadata("FunDefaultArg.kt") public void testFunDefaultArg() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/FunDefaultArg.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunDefaultArg.kt"); } @TestMetadata("FunParamNotNull.kt") public void testFunParamNotNull() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/FunParamNotNull.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunParamNotNull.kt"); } @TestMetadata("FunVarargInt.kt") public void testFunVarargInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInt.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInt.kt"); } @TestMetadata("FunVarargInteger.kt") public void testFunVarargInteger() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInteger.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInteger.kt"); } @TestMetadata("ModifierAbstract.kt") public void testModifierAbstract() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierAbstract.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierAbstract.kt"); } @TestMetadata("ModifierOpen.kt") public void testModifierOpen() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierOpen.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ModifierOpen.kt"); } @TestMetadata("NsFun.kt") public void testNsFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/NsFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/NsFun.kt"); } @TestMetadata("NsFunGetFoo.kt") public void testNsFunGetFoo() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/NsFunGetFoo.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/NsFunGetFoo.kt"); } @TestMetadata("ReturnTypeNotNull.kt") public void testReturnTypeNotNull() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNotNull.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNotNull.kt"); } @TestMetadata("ReturnTypeNullable.kt") public void testReturnTypeNullable() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNullable.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNullable.kt"); } } @@ -598,7 +598,7 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("nonLastVararg.kt") public void testNonLastVararg() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/fun/vararg/nonLastVararg.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/fun/vararg/nonLastVararg.kt"); } } @@ -615,6 +615,7 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso } @TestMetadata("compiler/testData/loadKotlin/prop") + @InnerTestClasses({Prop.DefaultAccessors.class}) public static class Prop extends AbstractLazyResolveNamespaceComparingTest { public void testAllFilesPresentInProp() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop"), Pattern.compile("^(.+)\\.kt$"), true); @@ -622,154 +623,223 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("ClassVal.kt") public void testClassVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ClassVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ClassVal.kt"); } @TestMetadata("ClassValAbstract.kt") public void testClassValAbstract() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ClassValAbstract.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ClassValAbstract.kt"); } @TestMetadata("ClassVar.kt") public void testClassVar() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ClassVar.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ClassVar.kt"); } @TestMetadata("CollectionSize.kt") public void testCollectionSize() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/CollectionSize.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/CollectionSize.kt"); } @TestMetadata("ExtValClass.kt") public void testExtValClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValClass.kt"); } @TestMetadata("ExtValInClass.kt") public void testExtValInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValInClass.kt"); } @TestMetadata("ExtValInt.kt") public void testExtValInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValInt.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValInt.kt"); } @TestMetadata("ExtValIntCharSequence.kt") public void testExtValIntCharSequence() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValIntCharSequence.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValIntCharSequence.kt"); } @TestMetadata("ExtValIntCharSequenceQ.kt") public void testExtValIntCharSequenceQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValIntCharSequenceQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValIntCharSequenceQ.kt"); } @TestMetadata("ExtValIntListQOfIntInClass.kt") public void testExtValIntListQOfIntInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValIntListQOfIntInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValIntListQOfIntInClass.kt"); } @TestMetadata("ExtValIntTInClass.kt") public void testExtValIntTInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValIntTInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValIntTInClass.kt"); } @TestMetadata("ExtValIntTQInClass.kt") public void testExtValIntTQInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValIntTQInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValIntTQInClass.kt"); } @TestMetadata("ExtValTIntInClass.kt") public void testExtValTIntInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtValTIntInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtValTIntInClass.kt"); } @TestMetadata("ExtVarClass.kt") public void testExtVarClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarClass.kt"); } @TestMetadata("ExtVarInClass.kt") public void testExtVarInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarInClass.kt"); } @TestMetadata("ExtVarInt.kt") public void testExtVarInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarInt.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarInt.kt"); } @TestMetadata("ExtVarIntTInClass.kt") public void testExtVarIntTInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarIntTInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarIntTInClass.kt"); } @TestMetadata("ExtVarIntTQInClass.kt") public void testExtVarIntTQInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarIntTQInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarIntTQInClass.kt"); } @TestMetadata("ExtVarMapPQInt.kt") public void testExtVarMapPQInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarMapPQInt.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarMapPQInt.kt"); } @TestMetadata("ExtVarTIntInClass.kt") public void testExtVarTIntInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarTIntInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarTIntInClass.kt"); } @TestMetadata("ExtVarTQIntInClass.kt") public void testExtVarTQIntInClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarTQIntInClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarTQIntInClass.kt"); } @TestMetadata("ExtVarl.kt") public void testExtVarl() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/ExtVarl.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/ExtVarl.kt"); } @TestMetadata("NsVal.kt") public void testNsVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/NsVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/NsVal.kt"); } @TestMetadata("NsVar.kt") public void testNsVar() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/NsVar.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/NsVar.kt"); } @TestMetadata("OverrideClassVal.kt") public void testOverrideClassVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/OverrideClassVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/OverrideClassVal.kt"); } @TestMetadata("OverrideTraitVal.kt") public void testOverrideTraitVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/OverrideTraitVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/OverrideTraitVal.kt"); } @TestMetadata("PropFromSuperclass.kt") public void testPropFromSuperclass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/PropFromSuperclass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/PropFromSuperclass.kt"); } @TestMetadata("TraitFinalVar.kt") public void testTraitFinalVar() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/TraitFinalVar.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/TraitFinalVar.kt"); } @TestMetadata("TraitOpenVal.kt") public void testTraitOpenVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/TraitOpenVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/TraitOpenVal.kt"); } @TestMetadata("VarDelegationToTraitImpl.kt") public void testVarDelegationToTraitImpl() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/prop/VarDelegationToTraitImpl.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/VarDelegationToTraitImpl.kt"); } + @TestMetadata("compiler/testData/loadKotlin/prop/defaultAccessors") + public static class DefaultAccessors extends AbstractLazyResolveNamespaceComparingTest { + public void testAllFilesPresentInDefaultAccessors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop/defaultAccessors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassVal.kt") + public void testClassVal() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt"); + } + + @TestMetadata("ClassValParams.kt") + public void testClassValParams() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt"); + } + + @TestMetadata("ClassValWithGet.kt") + public void testClassValWithGet() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt"); + } + + @TestMetadata("ClassVar.kt") + public void testClassVar() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt"); + } + + @TestMetadata("ClassVarModality.kt") + public void testClassVarModality() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt"); + } + + @TestMetadata("ClassVarParams.kt") + public void testClassVarParams() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt"); + } + + @TestMetadata("ClassVarWithGet.kt") + public void testClassVarWithGet() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt"); + } + + @TestMetadata("ClassVarWithSet.kt") + public void testClassVarWithSet() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt"); + } + + @TestMetadata("ExtValLong.kt") + public void testExtValLong() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt"); + } + + @TestMetadata("ExtVarLong.kt") + public void testExtVarLong() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt"); + } + + @TestMetadata("ExtVarLongWithSet.kt") + public void testExtVarLongWithSet() throws Exception { + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Prop"); + suite.addTestSuite(Prop.class); + suite.addTestSuite(DefaultAccessors.class); + return suite; + } } @TestMetadata("compiler/testData/loadKotlin/type") @@ -780,147 +850,147 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("Any.kt") public void testAny() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/Any.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/Any.kt"); } @TestMetadata("AnyQ.kt") public void testAnyQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/AnyQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/AnyQ.kt"); } @TestMetadata("ArrayOfInNumber.kt") public void testArrayOfInNumber() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfInNumber.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfInNumber.kt"); } @TestMetadata("ArrayOfInt.kt") public void testArrayOfInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfInt.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfInt.kt"); } @TestMetadata("ArrayOfInteger.kt") public void testArrayOfInteger() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfInteger.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfInteger.kt"); } @TestMetadata("ArrayOfOutNumber.kt") public void testArrayOfOutNumber() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfOutNumber.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfOutNumber.kt"); } @TestMetadata("ArrayOfOutT.kt") public void testArrayOfOutT() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfOutT.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfOutT.kt"); } @TestMetadata("ArrayOfString.kt") public void testArrayOfString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ArrayOfString.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ArrayOfString.kt"); } @TestMetadata("Function1IntString.kt") public void testFunction1IntString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/Function1IntString.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/Function1IntString.kt"); } @TestMetadata("Int.kt") public void testInt() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/Int.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/Int.kt"); } @TestMetadata("IntArray.kt") public void testIntArray() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/IntArray.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/IntArray.kt"); } @TestMetadata("IntQ.kt") public void testIntQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/IntQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/IntQ.kt"); } @TestMetadata("jlInteger.kt") public void testJlInteger() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlInteger.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlInteger.kt"); } @TestMetadata("jlIntegerQ.kt") public void testJlIntegerQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlIntegerQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlIntegerQ.kt"); } @TestMetadata("jlNumber.kt") public void testJlNumber() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlNumber.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlNumber.kt"); } @TestMetadata("jlObject.kt") public void testJlObject() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlObject.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlObject.kt"); } @TestMetadata("jlObjectQ.kt") public void testJlObjectQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlObjectQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlObjectQ.kt"); } @TestMetadata("jlString.kt") public void testJlString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlString.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlString.kt"); } @TestMetadata("jlStringQ.kt") public void testJlStringQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/jlStringQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/jlStringQ.kt"); } @TestMetadata("ListOfAny.kt") public void testListOfAny() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ListOfAny.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ListOfAny.kt"); } @TestMetadata("ListOfAnyQ.kt") public void testListOfAnyQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ListOfAnyQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ListOfAnyQ.kt"); } @TestMetadata("ListOfStar.kt") public void testListOfStar() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ListOfStar.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ListOfStar.kt"); } @TestMetadata("ListOfString.kt") public void testListOfString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ListOfString.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ListOfString.kt"); } @TestMetadata("ListOfjlString.kt") public void testListOfjlString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/ListOfjlString.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/ListOfjlString.kt"); } @TestMetadata("Nothing.kt") public void testNothing() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/Nothing.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/Nothing.kt"); } @TestMetadata("NothingQ.kt") public void testNothingQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/NothingQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/NothingQ.kt"); } @TestMetadata("String.kt") public void testString() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/String.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/String.kt"); } @TestMetadata("StringQ.kt") public void testStringQ() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/StringQ.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/StringQ.kt"); } @TestMetadata("Tuple0.kt") public void testTuple0() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/type/Tuple0.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/type/Tuple0.kt"); } } @@ -933,52 +1003,52 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso @TestMetadata("InternalAbstractTraitMembersOverridden.kt") public void testInternalAbstractTraitMembersOverridden() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); } @TestMetadata("InternalClass.kt") public void testInternalClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalClass.kt"); } @TestMetadata("InternalConstructor.kt") public void testInternalConstructor() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalConstructor.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalConstructor.kt"); } @TestMetadata("InternalTopLevelMembers.kt") public void testInternalTopLevelMembers() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalTopLevelMembers.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalTopLevelMembers.kt"); } @TestMetadata("InternalTraitMembers.kt") public void testInternalTraitMembers() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalTraitMembers.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalTraitMembers.kt"); } @TestMetadata("InternalTraitMembersInherited.kt") public void testInternalTraitMembersInherited() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/InternalTraitMembersInherited.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/InternalTraitMembersInherited.kt"); } @TestMetadata("PrivateClass.kt") public void testPrivateClass() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/PrivateClass.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/PrivateClass.kt"); } @TestMetadata("PrivateTopLevelFun.kt") public void testPrivateTopLevelFun() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/PrivateTopLevelFun.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/PrivateTopLevelFun.kt"); } @TestMetadata("PrivateTopLevelVal.kt") public void testPrivateTopLevelVal() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/PrivateTopLevelVal.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/PrivateTopLevelVal.kt"); } @TestMetadata("TopLevelVarWithPrivateSetter.kt") public void testTopLevelVarWithPrivateSetter() throws Exception { - doTestCheckingPrimaryConstructors("compiler/testData/loadKotlin/visibility/TopLevelVarWithPrivateSetter.kt"); + doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/visibility/TopLevelVarWithPrivateSetter.kt"); } } @@ -992,7 +1062,7 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso suite.addTest(Constructor.innerSuite()); suite.addTestSuite(DataClass.class); suite.addTest(Fun.innerSuite()); - suite.addTestSuite(Prop.class); + suite.addTest(Prop.innerSuite()); suite.addTestSuite(Type.class); suite.addTestSuite(Visibility.class); return suite; diff --git a/compiler/tests/org/jetbrains/jet/test/util/NamespaceComparator.java b/compiler/tests/org/jetbrains/jet/test/util/NamespaceComparator.java index 6519f5a39e3..d36998f7991 100644 --- a/compiler/tests/org/jetbrains/jet/test/util/NamespaceComparator.java +++ b/compiler/tests/org/jetbrains/jet/test/util/NamespaceComparator.java @@ -45,8 +45,8 @@ import java.util.Collections; import java.util.List; public class NamespaceComparator { - public static final Configuration DONT_INCLUDE_METHODS_OF_OBJECT = new Configuration(false, false, Predicates.alwaysTrue()); - public static final Configuration RECURSIVE = new Configuration(false, true, Predicates.alwaysTrue()); + public static final Configuration DONT_INCLUDE_METHODS_OF_OBJECT = new Configuration(false, false, false, Predicates.alwaysTrue()); + public static final Configuration RECURSIVE = new Configuration(false, false, true, Predicates.alwaysTrue()); private static final DescriptorRenderer RENDERER = new DescriptorRendererBuilder() .setWithDefinedIn(false) @@ -98,6 +98,22 @@ public class NamespaceComparator { printer.popIndent().println("}"); } } + else if (conf.checkPropertyAccessors && descriptor instanceof PropertyDescriptor) { + printer.printlnWithNoIndent(); + printer.pushIndent(); + PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor; + PropertyGetterDescriptor getter = propertyDescriptor.getGetter(); + if (getter != null) { + printer.println(RENDERER.render(getter)); + } + + PropertySetterDescriptor setter = propertyDescriptor.getSetter(); + if (setter != null) { + printer.println(RENDERER.render(setter)); + } + + printer.popIndent(); + } else { printer.printlnWithNoIndent(); } @@ -198,25 +214,32 @@ public class NamespaceComparator { public static class Configuration { private final boolean checkPrimaryConstructors; + private final boolean checkPropertyAccessors; private final boolean includeMethodsOfJavaObject; private final Predicate recurseIntoPackage; public Configuration( boolean checkPrimaryConstructors, + boolean checkPropertyAccessors, boolean includeMethodsOfJavaObject, Predicate recurseIntoPackage ) { this.checkPrimaryConstructors = checkPrimaryConstructors; + this.checkPropertyAccessors = checkPropertyAccessors; this.includeMethodsOfJavaObject = includeMethodsOfJavaObject; this.recurseIntoPackage = recurseIntoPackage; } public Configuration filterRecursion(@NotNull Predicate recurseIntoPackage) { - return new Configuration(checkPrimaryConstructors, includeMethodsOfJavaObject, recurseIntoPackage); + return new Configuration(checkPrimaryConstructors, checkPropertyAccessors, includeMethodsOfJavaObject, recurseIntoPackage); } public Configuration checkPrimaryConstructors(boolean checkPrimaryConstructors) { - return new Configuration(checkPrimaryConstructors, includeMethodsOfJavaObject, recurseIntoPackage); + return new Configuration(checkPrimaryConstructors, checkPropertyAccessors, includeMethodsOfJavaObject, recurseIntoPackage); + } + + public Configuration checkPropertyAccessors(boolean checkPropertyAccessors) { + return new Configuration(checkPrimaryConstructors, checkPropertyAccessors, includeMethodsOfJavaObject, recurseIntoPackage); } } } diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index 714686d4ceb..ef7dc4c2ee2 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -140,7 +140,7 @@ public class GenerateTests { "compiler/tests/", "LoadCompiledKotlinTestGenerated", AbstractLoadCompiledKotlinTest.class, - testModel("compiler/testData/loadKotlin") + testModel("compiler/testData/loadKotlin", "doTestWithAccessors") ); generateTest( @@ -199,7 +199,7 @@ public class GenerateTests { "compiler/tests/", "LazyResolveNamespaceComparingTestGenerated", AbstractLazyResolveNamespaceComparingTest.class, - testModel("compiler/testData/loadKotlin", "doTestCheckingPrimaryConstructors"), + testModel("compiler/testData/loadKotlin", "doTestCheckingPrimaryConstructorsAndAccessors"), testModel("compiler/testData/loadJava/compiledJavaCompareWithKotlin", "doTestNotCheckingPrimaryConstructors"), testModel("compiler/testData/lazyResolve/namespaceComparator", "doTestCheckingPrimaryConstructors") );