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

Making more use of the new filter system #95

Open
mascarenhas opened this issue Jul 16, 2016 · 0 comments
Open

Making more use of the new filter system #95

mascarenhas opened this issue Jul 16, 2016 · 0 comments

Comments

@mascarenhas
Copy link
Collaborator

New filter/projection system in place. Now it is a matter of adding filtering to the right side of boolean expressions based on the filters on the left side, plus a filter for assert. We can probably be more aggressive when narrowing types via assignment, and do it everytime instead of just if the right hand of the assignment is an or:

-- foo is declared as string|number|nil
foo = tostring(foo) -- foo now is a string
foo = tonumber(foo) -- foo now is a number (reverts to string|number|nil, then narrow again)
foo = f() -- f: () -> number|string, foo now is number|string
foo = g() -- g: () -> number|string|nil, foo reverts to its original type

This is technically easy to do, and sound if the standard limitations of filters are respected, but I worry it might be too confusing.

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

1 participant