Skip to content

Constraints<T> over a record from another assembly emits an action for <Clone>$ #91

Closed

Description

@Mpdreamz

[Constraints<Order>], where Order is a record declared in another assembly, generates an action for the compiler-generated <Clone>$ method, and the generated code does not compile. Compiler-generated members (unspeakable names) should be skipped.

Found while compiling the README snippets; not fixed there.

🤖 Generated with Claude Code

Activity

  1. Mpdreamz commented on Nov 12, 2026

    @Mpdreamz
    ContributorAuthor

    Still reproduces after the dependency bump (#92). A Lib/App pair with [Constraints<Order>] over a record from another assembly generates new EntityAction<Order>("<Clone>$", null, (x, _) => x.<Clone>$()), which fails with CS1001/CS1056.

    Likely cause: the member filter in ActionsMember (ConstraintGenerator.cs, around line 502) relies on IsImplicitlyDeclared, which is false for symbols read from metadata. Adding a CanBeReferencedByName check should skip compiler-generated members like <Clone>$.

    🤖 Generated with Claude Code

  2. Mpdreamz commented on Nov 19, 2026

    @Mpdreamz
    ContributorAuthor

    Reproduced with a test that compiles a Lib assembly and references it as metadata: the generated source contained <Clone>$. Your diagnosis was right. IsImplicitlyDeclared is false for metadata symbols, so the method filter in ActionsMember let it through. Adding !method.CanBeReferencedByName fixes it. PR: #99

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

    bugA defect fixed (patch)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions