racket / racket/typed-racket

Ability to expand types in error messages

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

Nobody has claimed this yet.

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

Description

Related: #334 Automatically suggest useful type aliases


When a type error is shown, sometimes the type is hidden behind an inscrutable alias.

It would be nice to have a little triangle icon like for snip% syntax objects, that expands the alias just like (:type some-alias) does at the REPL (and do this recursively).

There are two reasons that make it impossible to manually call (:type some-alias) and make this feature desirable:

  • Often the type error is bad enough that the REPL does not contain any definitions from the file
  • If the type is defined by a hygienic macro, it may be inaccessible in the REPL anyway.

Another easier to implement approach would be to have the full type in a "whole-type...:" partially hidden error field.

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

No files or tests are named. Start by comparing the existing triangle expansion for snip% syntax objects with the REPL's (:type some-alias) behavior, and review related issue #334. Done means error messages can expose aliased types recursively, or provide a partially hidden whole-type field, including aliases from hygienic macros.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.