enum primary constructor fixed
This commit is contained in:
@@ -14,7 +14,7 @@ public class Constructor extends Function {
|
||||
}
|
||||
|
||||
public String primary() {
|
||||
return "(" + myParams.toKotlin() + ")";
|
||||
return modifiersToKotlin() + "(" + myParams.toKotlin() + ")" + SPACE + myBlock.toKotlin();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -33,8 +33,9 @@ public class Enum extends Class {
|
||||
@NotNull
|
||||
@Override
|
||||
public String toKotlin() {
|
||||
return modifiersToKotlin() + "enum" + SPACE + myName.toKotlin() + typeParametersToKotlin() + primaryConstructorToKotlin() + implementTypesToKotlin() + SPACE + "{" + N +
|
||||
return modifiersToKotlin() + "enum" + SPACE + myName.toKotlin() + typeParametersToKotlin() + implementTypesToKotlin() + SPACE + "{" + N +
|
||||
AstUtil.joinNodes(myFields, N) + N +
|
||||
primaryConstructorToKotlin() + N +
|
||||
AstUtil.joinNodes(methodsExceptConstructors(), N) + N +
|
||||
AstUtil.joinNodes(myInnerClasses, N) + N +
|
||||
"}";
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Function extends Member {
|
||||
private final Type myType;
|
||||
private final List<Element> myTypeParameters;
|
||||
final Element myParams;
|
||||
private final Block myBlock;
|
||||
final Block myBlock;
|
||||
|
||||
public Function(Identifier name, Set<String> modifiers, Type type, List<Element> typeParameters, Element params, Block block) {
|
||||
myName = name;
|
||||
@@ -48,7 +48,7 @@ public class Function extends Member {
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
private String modifiersToKotlin() {
|
||||
String modifiersToKotlin() {
|
||||
List<String> modifierList = new LinkedList<String>();
|
||||
|
||||
if (myModifiers.contains(Modifier.OVERRIDE))
|
||||
|
||||
Reference in New Issue
Block a user