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

Using plus in module affects type environment in the rest of the code. #7275

Closed
cristianoc opened this issue Feb 4, 2025 · 0 comments · Fixed by #7277
Closed

Using plus in module affects type environment in the rest of the code. #7275

cristianoc opened this issue Feb 4, 2025 · 0 comments · Fixed by #7277

Comments

@cristianoc
Copy link
Collaborator

See change in:
https://github.com/rescript-lang/rescript/pull/7057/files#r1941028210

The following code does not typecheck:

module X = {
  type t = int
  let n : t => t = x => x+1
}

let z : X.t = 3

Outside the module, the fact that type X.t is the same as int is lost. This happens only with the unused binding to n.
Presumably the type environment is left in some inconsistent state, or something.

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

Successfully merging a pull request may close this issue.

1 participant