Revert "fix double-expansion in class"

This reverts commit 005b3f720f.

The expander's definition of "same context" is not flexible
enough, and introducing an extra `#%expression` wrapper
breaks TR's recognition of expanded classes. Revisit in the
near future.
This commit is contained in:
Matthew Flatt 2015-03-18 08:02:11 -06:00
parent f73b4066a7
commit 6752534da8

View File

@ -33,17 +33,13 @@
;; A wrapper macro that runs the `need-undeed-check?` analysis
;; and adds a boolean argument to a call to `compose-class`:
(define-syntax (detect-field-unsafe-undefined stx)
(cond
[(eq? 'expression (syntax-local-context))
(syntax-case stx ()
[(_ compose-class arg ... proc final)
(let-values ([(exp exp-proc) (syntax-local-expand-expression #'proc)])
(with-syntax ([exp-proc exp-proc]
[need-undef? (need-undefined-check? exp)])
(syntax/loc stx
(compose-class arg ... exp-proc need-undef? final))))])]
[else
#`(#%expression #,stx)]))
(syntax-case stx ()
[(_ compose-class arg ... proc final)
(let-values ([(exp exp-proc) (syntax-local-expand-expression #'proc)])
(with-syntax ([exp-proc exp-proc]
[need-undef? (need-undefined-check? exp)])
(syntax/loc stx
(compose-class arg ... proc need-undef? final))))]))
;; Analysis to detect whether any field can be referenced while
;; its value is `unsafe-undefined`, based on `declare-...` annotations