Skip to content

Assignment/Object Creation fails for non-@ref/@ref:external properties when reusing a value object previously assigned to an @ref/@ref:external property. #15

@plamen-neykov

Description

@plamen-neykov

Summary

Assignment (and/or object creation) fails for properties without @ref / @ref:external metadata when the same value object instance was previously assigned to a different property that is decorated with @ref or @ref:external.

Observed Behaviour

When a value object V is first assigned to a “tagged” property (e.g., propTagged annotated with @ref or @ref:external), subsequent attempts to assign that same object V to an “untagged” property (e.g., propPlain with no @ref/@ref:external) fail.

This can happen during:

  • direct property assignment, and/or
  • object construction / deserialization where the same value object is reused across properties.

Expected Behavior

Reusing the same value object instance across different properties should not cause assignment/creation to fail solely due to metadata differences between the properties. If V is valid for propPlain by type/shape, it should assign successfully regardless of whether it was previously used with a @ref / @ref:external tagged property.

Workaround

  • Cloning/copying the value object before assigning to the untagged property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions