racket / racket/typed-racket

Warning for unannotated optional arguments.

Open
#308 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

As a TR user I'm glad that optional arguments don't need to be documented in a require/typed form, but when writing code I'd rather have a warning if I forget to annotate an optional argument.

  (: f (->* [Natural] [] Natural))
  (define (f n #:foo [x 0])
    x)
  ;; Should raise a compile-time warning, or error with the right commandline flag

(This'd help prevent bugs like https://github.com/racket/plot/pull/12)

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 shown typed function with an optional #:foo argument and inspect how require/typed handles optional arguments. Define the warning or command-line-controlled error behavior, then verify that the example reports the unannotated optional argument without rejecting correctly annotated code.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.