minor cleanup
This commit is contained in:
parent
b42034f98b
commit
f749ab1538
|
@ -3228,25 +3228,16 @@ An example
|
||||||
|
|
||||||
c))))
|
c))))
|
||||||
|
|
||||||
(define (blame-add-method-context blame thing)
|
(define (blame-add-method-context blame name)
|
||||||
(cond
|
(cond
|
||||||
[(and (procedure? thing)
|
[(symbol? name)
|
||||||
(object-name thing))
|
|
||||||
(define name (object-name thing))
|
|
||||||
;; the procedure name of a method has ' method in ...' in it; trim that away
|
|
||||||
(define method-name (regexp-replace #rx" method in .*%.?$" (symbol->string name) ""))
|
|
||||||
(blame-add-context blame
|
(blame-add-context blame
|
||||||
(format "the ~a method in" method-name)
|
(format "the ~a method in" name)
|
||||||
#:important
|
#:important
|
||||||
name)]
|
name)]
|
||||||
[(symbol? thing)
|
[(not name)
|
||||||
;; the procedure name of a method has ' method in ...' in it; trim that away
|
(blame-add-context blame "an unnamed method in")]
|
||||||
(blame-add-context blame
|
[else (error 'blame-add-method-context "uhoh ~s" name)]))
|
||||||
(format "the ~a method in" thing)
|
|
||||||
#:important
|
|
||||||
thing)]
|
|
||||||
[else
|
|
||||||
(blame-add-context blame "an unnamed method in")]))
|
|
||||||
|
|
||||||
(define-struct class/c
|
(define-struct class/c
|
||||||
(methods method-contracts fields field-contracts inits init-contracts
|
(methods method-contracts fields field-contracts inits init-contracts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user