You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
type inference resolves custom types from scopes to be "never" when using them in a union typeΒ #1422
Other context you think may be relevant (JS flavor, OS, etc.):
π§βπ» Repro
When using types from scopes in a union, arktype will resolve some of them to be "never", however if you insert their definition directly it resolves the type correctly
Here is an example. If you paste this in the playground and hover of the out, the type of the fields will resolve to "never"
Interestingly the .expression tab in the playground resolves the native Typescript expression correctly
Is this a bug or am I misusing scopes in some way?
Activity
simonwkla commentedon Apr 15, 2025
I did some digging and the problem seems to be that in the
NaryUnionParserthe scope is not passed totype.inferWhen i change these lines
arktype/ark/type/nary.ts
Lines 22 to 25 in 2614ce8
to
it works.
Is there are reason why the scope is not passed to
type.inferhere?arktypeio#1422: fix nary type inference for scopes
issue arktypeio#1422: fix nary type inference for scopes
issue arktypeio#1422: fix nary type inference for scopes
issue arktypeio#1422: fix nary type inference for scopes
issue arktypeio#1422: fix nary type inference for scopes
issue arktypeio#1422: fix nary type inference for scopes
fix arktypeio#1422: adjust nary.test.ts, removed redundant tests, simβ¦