Skip to content

Fix duplicate attribute injection in Code Generator #162

@cct08311github

Description

@cct08311github

The regular expression used in CodeGenVM.InjectAnalysisAttributes to check for existing [Dimension] or [Measure] attributes is too strict. It requires the attribute to be immediately above the property. If there are other attributes (like [Required]) or comments in between, it fails to detect the existing attribute and injects duplicates, causing compiler errors. The fix replaces the regex with a robust string block search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions