Open greghendershott opened 4 years ago
Do we want an arrow for f
in the following scenario (from define
to private
)?
(class object%
(super-new)
(private f)
(define (f) 1))
If the answer is yes, then perhaps a solution is to add a new kind of syntax property, like disable-no-bound-occurrence
. The class
form should attach this syntax property, and then Check Syntax would need to be modified to skip reporting no bound occurrences when this syntax property is found.
If the answer is no, then I think we can simply change the class
form to remove disappeared-binding
.
Hmm.
#lang racket
(define-syntax-rule (p x)
(begin
(provide x)
(define x 1)))
(p a)
reports that a
in (p a)
has no bound occurrences. This p
is similar to define/private
because define/private
similarly expands to (begin (private x) (define (x ...) ...))
.
So I think there are two bugs here.
define
to the identifier in private
(in the above comment). This should be fixed so that it's similar to how there's an arrow from define
to provide
.define/private
and p
, there should be a general mechanism to detect that the identifier is "used" already in the expanded form so that it skips reporting "no bound occurrences". That means my ad-hoc solution (disable-no-bound-occurrence
) doesn't look like a good idea anymore.For point 2 above, I think it might be fixable inside check syntax. If so, the fix would be some where in this general vicinity. It may be that the argument (connections
) needs some more information it, tho, I suppose.
As discussed here: https://github.com/greghendershott/racket-mode/issues/440
As with #366 I'm not sure if this can/should be fixed in
drracket/check-syntax
as opposed to the source e.g.racket/class
.