Description
RENAME MODULE OldModule TO NewModule; fails with:
Error: rename not supported for MODULE
Root Cause
Case mismatch between visitor and executor:
- Visitor (
visitor_entity.go:841): sets ObjectType: "MODULE" (uppercase)
- Executor (
cmd_rename.go:38): checks case "module": (lowercase)
The executor's switch statement at line 38 matches "module" but the visitor produces "MODULE", so it falls through to the default case which returns NewUnsupported.
Fix
Either:
- Change
visitor_entity.go:841 to ObjectType: "module" (consistent with all other rename types which are lowercase)
- Or add
strings.ToLower(s.ObjectType) in the switch
Reproduction
mxcli -c "CREATE MODULE OldMod; RENAME MODULE OldMod TO NewMod;" -p app.mpr
# Error: rename not supported for MODULE
Severity
Medium — feature is fully implemented but unreachable due to a one-character casing bug.
Description
RENAME MODULE OldModule TO NewModule;fails with:Root Cause
Case mismatch between visitor and executor:
visitor_entity.go:841): setsObjectType: "MODULE"(uppercase)cmd_rename.go:38): checkscase "module":(lowercase)The executor's switch statement at line 38 matches
"module"but the visitor produces"MODULE", so it falls through to the default case which returnsNewUnsupported.Fix
Either:
visitor_entity.go:841toObjectType: "module"(consistent with all other rename types which are lowercase)strings.ToLower(s.ObjectType)in the switchReproduction
Severity
Medium — feature is fully implemented but unreachable due to a one-character casing bug.