Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Dec 12, 2023
1 parent e43e184 commit 019dc8e
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3428,8 +3428,7 @@ f(x) = yt(x)
(define (type-for-closure-parameterized name P names fields types super)
(let ((n (length P))
(s (make-ssavalue)))
`((thunk
(lambda ()
`((thunk ,(linearize `(lambda ()
(() () 0 ())
(block (global ,name) (const ,name)
,@(map (lambda (p n) `(= ,p (call (core TypeVar) ',n (core Any)))) P names)
Expand All @@ -3440,22 +3439,22 @@ f(x) = yt(x)
(call (core _setsuper!) ,s ,super)
(= (outerref ,name) ,s)
(call (core _typebody!) ,s (call (core svec) ,@types))
(return (null))))))))
(return (null)))))))))

(define (type-for-closure name fields super)
(let ((s (make-ssavalue)))
`((thunk (lambda ()
(() () 0 ())
(block (global ,name) (const ,name)
(= ,s (call (core _structtype) (thismodule) (inert ,name) (call (core svec))
(call (core svec) ,@(map quotify fields))
(call (core svec))
(false) ,(length fields)))
(call (core _setsuper!) ,s ,super)
(= (outerref ,name) ,s)
(call (core _typebody!) ,s
(call (core svec) ,@(map (lambda (v) '(core Box)) fields)))
(return (null))))))))
`((thunk ,(linearize `(lambda ()
(() () 0 ())
(block (global ,name) (const ,name)
(= ,s (call (core _structtype) (thismodule) (inert ,name) (call (core svec))
(call (core svec) ,@(map quotify fields))
(call (core svec))
(false) ,(length fields)))
(call (core _setsuper!) ,s ,super)
(= (outerref ,name) ,s)
(call (core _typebody!) ,s
(call (core svec) ,@(map (lambda (v) '(core Box)) fields)))
(return (null)))))))))

;; better versions of above, but they get handled wrong in many places
;; need to fix that in order to handle #265 fully (and use the definitions)
Expand Down

0 comments on commit 019dc8e

Please sign in to comment.