Files
jak-project/test/goalc/source_templates/with_game/test-set-self.gc
T
2020-10-09 13:23:41 -04:00

19 lines
519 B
Common Lisp

(define format _format)
(deftype self-test-type (basic)
((self basic))
)
(defmethod new self-test-type ((allocation symbol) (type-to-make type))
(let ((obj (object-new)))
;; here the register of obj is used both as a "real" pointer and a GOAL pointer in the same instruction.
;; this was a tricky thing to get right in the old compiler, so its worth testing.
(set! (-> obj self) obj)
obj
)
)
(let ((temp (new 'global 'self-test-type)))
(format #t "~A~%" (eq? temp (-> temp self)))
)
0