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

Should operators on literals delay range check? #6

Open
Shachar opened this issue Jul 19, 2019 · 0 comments
Open

Should operators on literals delay range check? #6

Shachar opened this issue Jul 19, 2019 · 0 comments
Labels
language design Need to make a desion about the design of the language

Comments

@Shachar
Copy link
Collaborator

Shachar commented Jul 19, 2019

def var : S8 = 0 - 128;

Should it not compile, because 128 is not a valid number for the expected type S8? In which case, the code needs to be written as:
def var : S8 = expect!S16(0 - 128);

Or should the check for range be delayed? How about:

def var : S8 = 128 - 256;?

@Shachar Shachar added the language design Need to make a desion about the design of the language label Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language design Need to make a desion about the design of the language
Projects
None yet
Development

No branches or pull requests

1 participant