rescript-lang / rescript-lang/rescript-vscode

Wrong type annotation generated in the interface file

Open
#922 2 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

Original discussion:
https://forum.rescript-lang.org/t/missing-type-annotation-from-generated-interface-file/5065

Not sure if this is a bug or not but when I generated an interface file using the vscode extension, it converted this type:

type tokenType = | @as("bearer") Bearer

To this type:

type tokenType = Bearer

Produced this error:

Type declarations do not match:
  type tokenType = Bearer
is not included in
  type tokenType = Bearer
The internal representations for case Bearer are not equal.

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 by reproducing the reported conversion in the VSCode extension's interface-file generation flow, using the forum example with the @as("bearer") variant. Trace the generator entry point and verify the generated interface preserves the case annotation so the implementation and interface type-check without an internal-representation mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.