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:
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.
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.
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: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.