class-internal: avoid wrapping "immediate" opt/kw defaults (#3182)
When expanding a method definition, do not wrap the default expression for optional and keyword args if it matches `immediate-default?`
This commit is contained in:
parent
e8202b7fa3
commit
84f9126f77
|
@ -12,6 +12,7 @@
|
|||
racket/unsafe/undefined
|
||||
"class-undef.rkt"
|
||||
(for-syntax racket/stxparam
|
||||
racket/private/immediate-default
|
||||
syntax/kerncase
|
||||
syntax/stx
|
||||
syntax/name
|
||||
|
@ -528,7 +529,7 @@
|
|||
[(pair? vars)
|
||||
(syntax-case (car vars) ()
|
||||
[(id expr)
|
||||
(identifier? #'id)
|
||||
(and (identifier? #'id) (not (immediate-default? #'expr)))
|
||||
;; optional argument; need to wrap arg expression
|
||||
(cons
|
||||
(with-syntax ([expr (syntax/loc #'expr
|
||||
|
|
Loading…
Reference in New Issue
Block a user