Skip to content

Commit a2cf689

Browse files
akoclaude
andcommitted
fix: treat 'void' qualified name as VoidType in Java action return type
'returns void' parses as a bare qualified name (TypeEnumeration with EnumRef{Name:"void"}) because the grammar has no VOID keyword in the dataType rule. astDataTypeToJavaActionReturnType was falling through to the EntityType case, producing EntityType{Entity:".void"}, which caused CE1613 "The selected entity '.void' no longer exists." in Studio Pro. Fix: when the resolved entity name is "void" (case-insensitive, with or without the empty-module dot prefix), return VoidType instead. Also restore the full empty_java_action_argument.mdl content (module, entity, and java action setup) that was dropped during the rebase of the misc branch — git skipped the upstream fixup commits that added them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5fbead4 commit a2cf689

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

mdl/executor/cmd_javaactions.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,21 @@ func astDataTypeToJavaActionReturnType(dt ast.DataType) javaactions.CodeActionRe
571571
case ast.TypeEntity, ast.TypeEnumeration:
572572
// TypeEnumeration with a qualified name is treated as entity type here,
573573
// since the visitor can't distinguish entity types from enumeration types.
574+
// "void" parses as a bare qualified name; treat it as VoidType.
574575
entityName := ""
575576
if dt.EntityRef != nil {
576577
entityName = dt.EntityRef.Module + "." + dt.EntityRef.Name
577578
} else if dt.EnumRef != nil {
578579
entityName = dt.EnumRef.Module + "." + dt.EnumRef.Name
579580
}
581+
if strings.EqualFold(strings.TrimPrefix(entityName, "."), "void") {
582+
return &javaactions.VoidType{
583+
BaseElement: model.BaseElement{
584+
ID: model.ID(types.GenerateID()),
585+
TypeName: "CodeActions$VoidType",
586+
},
587+
}
588+
}
580589
return &javaactions.EntityType{
581590
BaseElement: model.BaseElement{
582591
ID: model.ID(types.GenerateID()),

0 commit comments

Comments
 (0)