rescript-lang / rescript-lang/rescript-vscode

Incorrect type shown for first argument of async function

Open
#1,042 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

For this function

let f = async (a, b) => a + b

the following types are shown on hover:

  1. Hover over f: (int, int) => promise<int> (correct)
  2. Hover over a: int => promise<int> (incorrect)
  3. Hover over b: int (correct)

Contributor guide

Open the contributing guide

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 with the minimal ReScript async example in the issue and reproduce the hover types for f, a, and b in the VSCode plugin. Trace the hover/type-information entry point and identify why the first parameter receives the function's return type; done means a shows int while f and b retain their expected types.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.