Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type annotation generated in the interface file #922

Open
soundstep opened this issue Feb 20, 2024 · 2 comments
Open

Wrong type annotation generated in the interface file #922

soundstep opened this issue Feb 20, 2024 · 2 comments

Comments

@soundstep
Copy link

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.
@zth
Copy link
Collaborator

zth commented Feb 23, 2024

@cristianoc see any easy way of supporting this?

@cristianoc
Copy link
Collaborator

cristianoc commented Feb 23, 2024

The information should be extracted from the types, assuming it's still available.
It should be available somewhere given the type error identifies that there is an inconsistency.
A first step would be fixing the compiler's type error to show the correct representation. Perhaps if the fix is to the printer for types, then that's the only fix required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants