racket / racket/typed-racket

require/typed extra includes aren't always included at the top-level

Open
#369 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
575
Forks
106
Avg merge
2h 1m
Merged PRs (30d)
2

Description

What version of Racket are you using

HEAD (6.5.0.5)

What program did you run?
Welcome to Racket v6.5.0.5.
-> (define-syntax (m stx)
     #'(begin (require/typed racket/base [#:struct exn ([message : String] [continuation-marks : Null])]) exn))
-> (m)
; link: bad variable linkage;
;  reference to a variable that is uninitialized
;   reference phase level: 0
;   variable module:
;     "/home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/utils/any-wrap.rkt"
;   variable phase: 0
;   reference in module: #f
;   in: struct-predicate-procedure?/c
; [,bt for context]
What should have happened?

I expected the contract wrapping to happen.

Possible solution: just always include the extra-requires in the top-level. I'm not sure why the flag isn't getting set properly for this case though, so that's maybe worrying.

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

Start by reproducing the linked require/typed example on the reported Racket version and inspect typed-racket/utils/any-wrap.rkt, especially the struct-predicate-procedure?/c linkage. Trace how extra-requires are collected for the macro-expanded top level. Done means the example performs contract wrapping without the bad variable linkage error, with a regression test for this case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.