Skip to content

positiveInteger and nonNegativeInteger values accept any int in mx::core #446

Description

@webern

gen/cpp/config.toml:68-70 maps integer, positive_integer and non_negative_integer all to
int. For example, core::Note::staff() is std::optional<int>, so <staff>0</staff> and
<staff>-3</staff> import with no error and no repair, and a caller can set them. That contradicts
the claim that invalid MusicXML cannot be represented in mx::core.

XSD simple types derived from these, such as staff-number, already have clamping wrappers
(core::StaffNumber). The plain primitives used directly by elements and attributes could get the
same treatment.

Related: #397, #398. Found while auditing silent recoveries for #432 (#439).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiIssues opened by, or through, a coding agent.bugsoftware defectcoreAffects the mx::core layerdesignNot a simple fix. Requires design decisions.genThe gen/ directory which is generating code from the spec

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions