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
While TR provides variadic type constructors like Values, U, and Sequenceof, users cannot define their own using define-type. Currently, define-type treats ... as a normal type argument. For instance, attempting to define a variadic My-Union:
> (define-type (My-Union t ...) (U t ...))
> (ann 1 (My-Union 10))
- : Integer [more precisely: (U One Zero)]
1
> (ann 1 (My-Union 1))
string:1:7: Type Checker: Error in macro expansion -- wrong number of arguments to type constructor
type: #<syntax:string:1:8 My-Union>
expected: 2
given: 1
in: (My-Union 1)
[,bt for context]
> (ann 1 (My-Union 210))
string:1:7: Type Checker: Error in macro expansion -- wrong number of arguments to type constructor
type: #<syntax:string:1:8 My-Union>
expected: 2
given: 3
in: (My-Union 210)
[,bt for context]
The text was updated successfully, but these errors were encountered:
While TR provides variadic type constructors like
Values
,U
, andSequenceof
, users cannot define their own usingdefine-type
. Currently,define-type
treats...
as a normal type argument. For instance, attempting to define a variadicMy-Union
:The text was updated successfully, but these errors were encountered: