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
Merely mentioning a recursive type in type() seems to break runtime:
import{ArkErrors,scope,type}from'arktype';const$=scope({// Note that using 'Record<string,value>' leads to an infinite type error in TSrecord: {'[string]': 'value'},value: 'boolean|record',}).export();// Commenting out this unused type fixes the issue/**/constinputType=type({input: $.value});/**/// Note we use $.value and don't touch inputType at all.constresult=$.value({input: true});if(resultinstanceofArkErrors){// ParseError: 'record' is unresolvablethrownewError(result.summary);}console.log('passed');
I guess the workaround would be to use scope() instead of type() and mentioning all dependencies manually, but it is not very convenient and the runtime breakage I am observing is a bit befuddling.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Merely mentioning a recursive type in
type()
seems to break runtime:I guess the workaround would be to use
scope()
instead oftype()
and mentioning all dependencies manually, but it is not very convenient and the runtime breakage I am observing is a bit befuddling.What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions