fix double-expansion in class
The `class` macro uses `synatx-local-expand-expression`, but it discarded the result and used the original, which implies re-expanding.
This commit is contained in:
parent
bb48859c9b
commit
005b3f720f
|
@ -33,13 +33,17 @@
|
||||||
;; A wrapper macro that runs the `need-undeed-check?` analysis
|
;; A wrapper macro that runs the `need-undeed-check?` analysis
|
||||||
;; and adds a boolean argument to a call to `compose-class`:
|
;; and adds a boolean argument to a call to `compose-class`:
|
||||||
(define-syntax (detect-field-unsafe-undefined stx)
|
(define-syntax (detect-field-unsafe-undefined stx)
|
||||||
(syntax-case stx ()
|
(cond
|
||||||
[(_ compose-class arg ... proc final)
|
[(eq? 'expression (syntax-local-context))
|
||||||
(let-values ([(exp exp-proc) (syntax-local-expand-expression #'proc)])
|
(syntax-case stx ()
|
||||||
(with-syntax ([exp-proc exp-proc]
|
[(_ compose-class arg ... proc final)
|
||||||
[need-undef? (need-undefined-check? exp)])
|
(let-values ([(exp exp-proc) (syntax-local-expand-expression #'proc)])
|
||||||
(syntax/loc stx
|
(with-syntax ([exp-proc exp-proc]
|
||||||
(compose-class arg ... proc need-undef? final))))]))
|
[need-undef? (need-undefined-check? exp)])
|
||||||
|
(syntax/loc stx
|
||||||
|
(compose-class arg ... exp-proc need-undef? final))))])]
|
||||||
|
[else
|
||||||
|
#`(#%expression #,stx)]))
|
||||||
|
|
||||||
;; Analysis to detect whether any field can be referenced while
|
;; Analysis to detect whether any field can be referenced while
|
||||||
;; its value is `unsafe-undefined`, based on `declare-...` annotations
|
;; its value is `unsafe-undefined`, based on `declare-...` annotations
|
||||||
|
|
Loading…
Reference in New Issue
Block a user