diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-06-12 20:25:51 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-06-12 20:25:51 +0100 |
| commit | fe0d7c79e4f0ee959fd3f10eb172e8e16dd72f69 (patch) | |
| tree | 56cfcde100ae811c87f969c2c8a578ed807aad04 /src/main/java/org/zwobble | |
| parent | 3f49a74a9d139b6f09e1515002d63ee0f5259e4d (diff) | |
Move Java interface openness to top-level type
Diffstat (limited to 'src/main/java/org/zwobble')
3 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javatypes/JavaTypesGenerator.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javatypes/JavaTypesGenerator.java index fe25a04..de33968 100644 --- a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javatypes/JavaTypesGenerator.java +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/javatypes/JavaTypesGenerator.java @@ -82,14 +82,14 @@ public class JavaTypesGenerator implements Generator { packageParts, new JavaInterfaceDeclaration( sumDefinition.name(), - JavaInterfaceDeclaration.Openness.SEALED, + JavaInterfaceOpenness.SEALED, sumDefinition.variants().stream() .map(variant -> generateTypeRef(variant.type(), context)) .toList(), List.of( new JavaInterfaceDeclaration( BUILDER_TYPE_NAME, - JavaInterfaceDeclaration.Openness.OPEN, + JavaInterfaceOpenness.OPEN, List.of(), List.of( new JavaMethodDeclaration( diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceDeclaration.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceDeclaration.java index a35de51..e3780c7 100644 --- a/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceDeclaration.java +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceDeclaration.java @@ -6,14 +6,10 @@ import java.util.List; public record JavaInterfaceDeclaration( String name, - Openness openness, + JavaInterfaceOpenness openness, List<JavaTypeRef> permitsTypes, List<JavaClassBodyDeclaration> body, JavaCustomArea customArea, DocComment docComment ) implements JavaTypeDeclaration { - public enum Openness { - OPEN, - SEALED - } } diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceOpenness.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceOpenness.java new file mode 100644 index 0000000..c6fa444 --- /dev/null +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/lang/java/ast/JavaInterfaceOpenness.java @@ -0,0 +1,6 @@ +package org.zwobble.hobgoblin.compiler.output.lang.java.ast; + +public enum JavaInterfaceOpenness { + OPEN, + SEALED +} |
