racket / racket/drracket

define-struct/contract members are always annotated "no bound occurrences"

Open
#366 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

Given:

#lang racket/base

(require racket/contract)

(struct plain (a b))
(plain 1 2)

(define-struct/contract contracted ([a any/c] [b any/c]))
(contracted 1 2)

The a and b members of contracted (but not of plain) are annotated "no bound occurrences".

This is true in both Dr Racket and Racket Mode. The presentation is more obvious in Racket Mode, because by default it is configured to show unused identifiers and requires with a strikeout font (as well as showing the mouseover text). Whereas in Dr Racket you would not notice unless you mouse hover.^1


^1: In general: The fact that Racket Mode more strongly "surfaces in the UI" annotations about unused items, with a configurable font, is for some users a positive feature. At the same time, that means it is going to surface more "edge" and/or "interesting" cases, like this -- fortunately or unfortunately.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported example in DrRacket and Racket Mode, comparing the annotations on the plain and contracted structures. Trace how the define-struct/contract members are classified for bound occurrences; done means the contracted members no longer show "no bound occurrences" while the plain-structure behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.