You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for IF-Statements to the type Inference algorithm. The following edge cases need to be
supported, as they are widely used.
Type inference needs to be branch specific
function(x){if(typeof(x)==='string'){// inside the branch x is of type stringx=parseInt(x,10);// type changes from string to int}returnx*x;// the type of x is always number}
The possible types of a variable after an if statement need to be the most common between all branches
if(y>10){x=10;// x is typeof numberelse{x=null;// x is typeof Null}returnx+10;// x is typeof Maybe<number>
The text was updated successfully, but these errors were encountered:
Add support for IF-Statements to the type Inference algorithm. The following edge cases need to be
supported, as they are widely used.
Type inference needs to be branch specific
The possible types of a variable after an if statement need to be the most common between all branches
The text was updated successfully, but these errors were encountered: