danielsun1106 commented on a change in pull request #1645:
URL: https://github.com/apache/groovy/pull/1645#discussion_r734118172
##########
File path: src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
##########
@@ -1603,21 +1604,18 @@ public ClassNode visitClassDeclaration(final
ClassDeclarationContext ctx) {
this.initUsingGenerics(classNode);
this.hackMixins(classNode);
- } else if (isEnum) {
+ } else if (isEnum || isRecord) {
classNode.setInterfaces(this.visitTypeList(ctx.is));
this.initUsingGenerics(classNode);
+ if (isRecord) {
+ transformRecordHeaderToProperties(ctx, classNode);
+ }
} else if (isAnnotation) {
classNode.setModifiers(classNode.getModifiers() |
Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_ANNOTATION);
classNode.addInterface(ClassHelper.Annotation_TYPE);
this.hackMixins(classNode);
- } else if (isRecord) {
- classNode.setModifiers(classNode.getModifiers() |
Opcodes.ACC_RECORD | Opcodes.ACC_FINAL);
-
classNode.setRecordComponentNodes(this.transformRecordHeaderToProperties(ctx,
classNode));
Review comment:
`setRecordComponentNodes` is not called in the PR, so no record
components are generated in bytecode.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]