Skip to content

Commit a2ac340

Browse files
committed
fix: DESCRIBE omits incorrect $ prefix on enum literal in RETURN
Bug #27: RETURN values containing qualified enum literals (e.g., Module.Enum.Value) were incorrectly prefixed with $, producing $Module.Enum.Value which causes CE0109 on roundtrip. Enum literals contain dots and should not be treated as variable names.
1 parent 73e70b0 commit a2ac340

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

mdl/executor/cmd_microflows_format_action.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (e *Executor) formatActivity(
2424
case *microflows.EndEvent:
2525
if activity.ReturnValue != "" {
2626
returnVal := strings.TrimSuffix(activity.ReturnValue, "\n")
27-
if !strings.HasPrefix(returnVal, "$") && !isMendixKeyword(returnVal) {
27+
if !strings.HasPrefix(returnVal, "$") && !isMendixKeyword(returnVal) && !isQualifiedEnumLiteral(returnVal) {
2828
returnVal = "$" + returnVal
2929
}
3030
return fmt.Sprintf("RETURN %s;", returnVal)
@@ -856,3 +856,9 @@ func isMendixKeyword(s string) bool {
856856
}
857857
return false
858858
}
859+
860+
// isQualifiedEnumLiteral returns true for qualified enum literals (e.g., "Module.Enum.Value")
861+
// that must not be prefixed with "$" when serialized as a RETURN value.
862+
func isQualifiedEnumLiteral(s string) bool {
863+
return strings.Contains(s, ".")
864+
}

0 commit comments

Comments
 (0)