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

Handle inference of multiple size for Int literals #118

Open
Champii opened this issue Jun 15, 2022 · 1 comment · May be fixed by #139
Open

Handle inference of multiple size for Int literals #118

Champii opened this issue Jun 15, 2022 · 1 comment · May be fixed by #139
Labels
bug Something isn't working enhancement New feature or request

Comments

@Champii
Copy link
Owner

Champii commented Jun 15, 2022

We currently only support Int64 when inferring integer literals.
We need a way to have a "generic" int that is either bound by constraints when used in the program or defaulting to Int64 if no particular need is expressed.

This fails with a type error between the 10 number literal that is an Int64 and the bar field that requires an Int16

struct Foo
  bar: Int16

main: ->
  let foo = Foo bar: 10
  foo.bar
@Champii Champii added the enhancement New feature or request label Jun 15, 2022
@Champii Champii added the bug Something isn't working label Jun 15, 2022
@Champii
Copy link
Owner Author

Champii commented Jun 16, 2022

We might need a proper type inference system with sub-typing support

@Champii Champii linked a pull request Jun 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant