syntax-local-infer-name: restore some lost generality
In #956, @gus-massa warned that `syntax-local-infer-name` was changed in a breaking way, but the implications were not clear. At a minimum, identifiers need to be treated like symbols, so that `mzlib/contract` name inference works right. I'm erroring more generally on the side of keeping the old behavior for anything other than pair-based trees. Closes #1117.
This commit is contained in:
parent
37dc3ffa01
commit
827fc45598
|
@ -8,8 +8,8 @@
|
|||
@defproc[(syntax-local-infer-name [stx syntax?] [use-local? any/c #t]) any/c]{
|
||||
|
||||
Similar to @racket[syntax-local-name], except that @racket[stx] is
|
||||
checked for an @racket['inferred-name] property that is a symbol
|
||||
(which overrides any inferred name) or @|void-const|.
|
||||
checked for an @racket['inferred-name] property
|
||||
(which overrides any inferred name).
|
||||
If neither @racket[syntax-local-name] nor
|
||||
@racket['inferred-name] produce a name, or if the
|
||||
@racket['inferred-name] property value is @|void-const|, then a name
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
(case-lambda
|
||||
[(stx use-local?)
|
||||
(let-values ([(prop) (simplify-inferred-name (syntax-property stx 'inferred-name))])
|
||||
(or (and (symbol? prop)
|
||||
(or (and prop
|
||||
(not (void? prop))
|
||||
prop)
|
||||
(let ([n (and use-local?
|
||||
(not (void? prop))
|
||||
|
|
Loading…
Reference in New Issue
Block a user