Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

struct-copy doesn't record field names as disappeared uses #4910

Open
LiberalArtist opened this issue Jan 25, 2024 · 0 comments
Open

struct-copy doesn't record field names as disappeared uses #4910

LiberalArtist opened this issue Jan 25, 2024 · 0 comments

Comments

@LiberalArtist
Copy link
Contributor

What version of Racket are you using?
8.11.1.10-2024-01-03-8ea7e0d830 [cs]

What program did you run?

#lang racket
(struct wrapped-list (content)
  #:transparent)
(define (wrapped-cons v w-l)
  (struct-copy wrapped-list w-l
               [content (cons v (wrapped-list-content w-l))]))

What should have happened?
DrRacket should show 2 bound occurrences of the content field, and using the context menu to rename the field to e.g. value should work.

If you got an error message, please include it here.
DrRacket shows only 1 bound occurrence, the accessor function. Renaming changes only that occurrence, not the field name used with struct-copy, so the program breaks:

#lang racket
(struct wrapped-list (value)
  #:transparent)
(define (wrapped-cons v w-l)
  (struct-copy wrapped-list w-l
               [content (cons v (wrapped-list-value w-l))]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant