-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
macros@macros@macros
Description
;; given the LHS of e.g. `x::Int -> y`, wrap the signature in `tuple` to normalize
(define (tuple-wrap-arrow-sig e)
(cond ((atom? e) `(tuple ,e))
((eq? (car e) 'where) `(where ,(tuple-wrap-arrow-arglist (cadr e)) ,@(cddr e)))
((eq? (car e) 'tuple) e)
((eq? (car e) 'escape) `(escape ,(tuple-wrap-arrow-sig (cadr e))))
(else `(tuple ,e))))
The tuple-wrap-arrow-arglist
function does not exist.
MWE
julia> macro x(); return :((() where T) -> ()); end; @x
(unbound-error tuple-wrap-arrow-arglist)
unexpected error: #0 (tuple-wrap-arrow-sig
(where (tuple) T))
#1 (resolve-expansion-vars-
(-> (where (tuple) T) (block (line 1 |REPL[3]|) (tuple))) () #<julia: Main>
((line 1 |REPL[3]|)) () #f)
ERROR: syntax: malformed expression
(added by Jeff in 646626e with no test so it was always broken)
Metadata
Metadata
Assignees
Labels
macros@macros@macros