rbsyn icon indicating copy to clipboard operation
rbsyn copied to clipboard

Eliminate programs that are not type correct

Open ngsankha opened this issue 6 years ago • 1 comments

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 avatar Dec 23 '19 23:12 ngsankha

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.

ngsankha avatar Jan 22 '20 14:01 ngsankha