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

Support union types in the typechecker #44

Open
polybuildr opened this issue Jun 10, 2017 · 1 comment
Open

Support union types in the typechecker #44

polybuildr opened this issue Jun 10, 2017 · 1 comment

Comments

@polybuildr
Copy link
Owner

Instead of falling back to plain old Any, the typechecker should support union types in cases where inference cannot settle on just one type (and in the future when explicit type annotations are supported).

Therefore, in cases like:

var x = 5;
if foo {
    x = true;
}

The typechecker should not give up and use Any, but instead have a Number | Bool type. This might need to happen after #26.

@bollu
Copy link
Contributor

bollu commented Jun 10, 2017 via email

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

No branches or pull requests

2 participants