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

Declaring types for local variables #739

Open
denismerigoux opened this issue Oct 30, 2024 · 1 comment
Open

Declaring types for local variables #739

denismerigoux opened this issue Oct 30, 2024 · 1 comment
Assignees
Labels
🔧 compiler Issue concerns the compiler ✨ enhancement New feature or request ❓ invalid This doesn't seem right

Comments

@denismerigoux
Copy link
Contributor

Right now, local variables inside scope variable definitions (let x equals ... in ... syntax) have their types inferred. However, if you define a local variable whose type cannot be inferred completely from its value (like []), this throws the desugared typing in a state of confusion and may trigger internal typing error.

This issue proposes to fix this problem with two measures :

  • when raising the internal error in desugared when there's not enough type information to disambiguate operators, the error message should inform the user that they need to type their local variables more explicitly to resolve ambiguity ;
  • users should be able to optionally type local variables with the syntax let x content Foo equals ... in ....
@denismerigoux denismerigoux added ✨ enhancement New feature or request ❓ invalid This doesn't seem right 🔧 compiler Issue concerns the compiler labels Oct 30, 2024
@AltGr
Copy link
Contributor

AltGr commented Oct 30, 2024

Related to #738 in that it could make this case more likely to happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 compiler Issue concerns the compiler ✨ enhancement New feature or request ❓ invalid This doesn't seem right
Projects
Status: Todo
Development

No branches or pull requests

3 participants