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

Eliminate programs that are not type correct #10

Open
ngsankha opened this issue Dec 23, 2019 · 1 comment
Open

Eliminate programs that are not type correct #10

ngsankha opened this issue Dec 23, 2019 · 1 comment

Comments

@ngsankha
Copy link
Owner

ngsankha commented Dec 23, 2019

Given a function argument of type { email: ?String, active: ?%bool, username: ?String, name: ?String }, and if asked to give a program that returns a String the synthesizer will return programs like:

arg0.[](:name)
arg0.[](:username)
arg0.[](:active)
arg0.[](:email)

The program with :active is not correct. Even though it can be eliminated after testing, doing so with type checking could be cheaper. Such programs are generated because the argument can be String or bool. But only after the argument is filled that the precise type can be calculated. Such kind of analysis can be directly implemented as well.

@ngsankha
Copy link
Owner Author

Intermediate AST node's types are refined now from commit e80be99. This makes the types more precise, so we can start eliminating more type incorrect programs.

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

No branches or pull requests

1 participant