schemify: fix handling of #<void> as 'inferred-name

It's not supposed to suppress a srcloc-based name.
This commit is contained in:
Matthew Flatt 2019-01-14 09:07:42 -07:00
parent 8b9525f1c9
commit 40bc59d512

View File

@ -4,15 +4,12 @@
(provide infer-procedure-name) (provide infer-procedure-name)
(define (infer-procedure-name orig-s new-s) (define (infer-procedure-name orig-s new-s)
(define inferred-name (wrap-property orig-s 'inferred-name))
(cond (cond
[(wrap-property orig-s 'inferred-name) [(symbol? inferred-name)
=> (lambda (v) ;; Let propagation of properties (at the call site of
(if (void? v) ;; `infer-procedure-name`) take care of it
(wrap-property-set (reannotate orig-s new-s) new-s]
'inferred-name
;; Hack: "[" means "no name"
'|[|)
new-s))]
[else [else
(define-values (src line col pos) (wrap-source orig-s)) (define-values (src line col pos) (wrap-source orig-s))
(define (add-property str) (define (add-property str)
@ -34,6 +31,13 @@
(string-append (source->string src) (string-append (source->string src)
"::" "::"
(number->string pos)))] (number->string pos)))]
[(void? inferred-name)
;; We can't provide a source name, but explicity
;; suppress any other inferred name:
(wrap-property-set (reannotate orig-s new-s)
'inferred-name
;; Hack: "[" means "no name"
'|[|)]
[else new-s])])) [else new-s])]))
(define (source->string src) (define (source->string src)