You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Section.Parse accepts numbers and comma lists as section types ([Verse, Chorus] parses as Chorus, [42] as undefined 42) #318
Section.TryParse (Semantics.Music/Section.cs ~L129) reads the header with Enum.TryParse<SectionType>(header[1..close], …). That call is too permissive for this header:
It accepts any integer string and returns an undefined enum value.
It accepts comma-separated names and ORs their values together, flags-style.
It trims surrounding whitespace.
SectionType is a plain enum, so the first two cases produce wrong or undefined types.
Priority: Medium. The parser accepts malformed headers ([Verse, Chorus], [42]) and produces undefined SectionType values, which then flow into IsSameStructure and Form. This is input validation, not data loss.
Area / suggested assignment:Semantics.Music/Section.TryParse (shared by Arrangement.Parse).
Suggested next step: require a letters-only header and add an Enum.IsDefined check, keeping the match case-sensitive. Add the four rejection tests listed in the issue.
Activity
matt-edmondson commentedon Sep 28, 2026
Triage
[Verse, Chorus],[42]) and produces undefinedSectionTypevalues, which then flow intoIsSameStructureandForm. This is input validation, not data loss.Semantics.Music/Section.TryParse(shared byArrangement.Parse).Section.ToStringround-trip issue, and the two could be fixed together.Suggested next step: require a letters-only header and add an
Enum.IsDefinedcheck, keeping the match case-sensitive. Add the four rejection tests listed in the issue.Generated by Claude Code
[patch] Accept only one declared SectionType name in a section header