Skip to content

test/ctors: introspect on the bare DataType, construct on the UnionAll#66

Open
Keno wants to merge 1 commit into
JuliaSNN:mainfrom
KenoAIStaging:fix/test-ctor-typeparams
Open

test/ctors: introspect on the bare DataType, construct on the UnionAll#66
Keno wants to merge 1 commit into
JuliaSNN:mainfrom
KenoAIStaging:fix/test-ctor-typeparams

Conversation

@Keno
Copy link
Copy Markdown

@Keno Keno commented May 24, 2026

test_typeparams was rebinding Model to coretype(Model) and then calling Model(args...), which only dispatched because Type{Foo{T,V}} <: Type{Foo} held under the old free-TypeVar subtype rules. JuliaLang/julia#61876 removes that subtype, and the @snn_kw-generated kwarg constructor (defined only on Type{Foo}) no longer matches.

Keep the original Model UnionAll for construction, and use a local DataType binding only where field introspection is needed.

The behavior of free TypeVars in subtyping was previously undefined (in effect a bug); JuliaLang/julia#61876 makes them well-defined singleton identities, which is what surfaces this latent issue.

This change was AI-generated and should be reviewed carefully before merging.

`test_typeparams` was rebinding `Model` to `coretype(Model)` and then calling
`Model(args...)`, which only dispatched because `Type{Foo{T,V}} <: Type{Foo}`
held under the old free-TypeVar subtype rules. JuliaLang/julia#61876 removes
that subtype, and the `@snn_kw`-generated kwarg constructor (defined only on
`Type{Foo}`) no longer matches.

Keep the original `Model` UnionAll for construction, and use a local DataType
binding only where field introspection is needed.

The behavior of free TypeVars in subtyping was previously undefined (in effect
a bug); JuliaLang/julia#61876 makes them well-defined singleton identities,
which is what surfaces this latent issue.

This change was AI-generated and should be reviewed carefully before merging.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant