racket / racket/typed-racket

match macro's pattern fail procedures need an import

Open
#693 4 comments 1 reaction 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?

v6.12

What program did you run?
#lang typed/racket

(match 5
  [5 (=> fail) (fail) 15]
  [5 10])
What should have happened?

Using #lang racket, the program outputs 10.

The error message requests an additional import. Adding

(require/typed racket/match/runtime
    [ match-prompt-tag (Prompt-Tagof Void (-> Void))])

doesn't help, so I assume that Typed Racket itself needs a similar import.

If you got an error message, please include it here.
a.rkt:7:9: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: match-prompt-tag
  from module: runtime.rkt
  in: fail

a.rkt:7:9: Type Checker: Polymorphic function `call-with-continuation-prompt' could not be applied to arguments:
Types: (-> b) -> Any
       (-> b) (Prompt-Tagof b (-> c ... c d)) (-> c ... c d) -> (U b d)
       (-> b) (Prompt-Tagof b (-> (-> d) d)) -> (U b d)
Arguments: (-> Nothing) Nothing (-> AnyValues)
Expected result: AnyValues

  in: fail

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 typed/racket program shown in the issue and compare it with the racket result. Start by tracing the match macro's fail procedure handling and the Typed Racket treatment of match-prompt-tag and call-with-continuation-prompt. Done means the example type-checks and runs without the user's manual require/typed import.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.