Skip to content

Commit 0d7b367

Browse files
committed
Dev: add support of enums for @SwiftValue
1 parent d8e7ef2 commit 0d7b367

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/src/main/java/com/readdle/codegen/JavaSwiftProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
9999

100100
for (Element annotatedElement : roundEnv.getElementsAnnotatedWith(SwiftValue.class)) {
101101
// Check if a class has been annotated with @SwiftValue
102-
if (annotatedElement.getKind() != ElementKind.CLASS) {
103-
error(annotatedElement, "Only classes can be annotated with @%s", SwiftValue.class.getSimpleName());
102+
if (annotatedElement.getKind() != ElementKind.CLASS && annotatedElement.getKind() != ElementKind.ENUM) {
103+
error(annotatedElement, "Only classes or enums can be annotated with @%s", SwiftValue.class.getSimpleName());
104104
return true; // Exit processing
105105
}
106106

0 commit comments

Comments
 (0)