Gradualizer
Gradualizer copied to clipboard
Define subtyping of unions with type difference
This borrows the idea of defining the subtyping relation from set-theoretic types, but we only use it for subtyping of unions. This issue was made clearly visible in @xxdavid's #564 and we spoke about it face to face on Lambda Days earlier this week.
However, there are some basic tests which stopped passing, like test/should_pass/guard.erl or lookup/2 in poly_should_pass.erl, so it needs more investigation. The main troublemaker, different_normalization_levels.erl, works now, though.
Impressive, thanks for trying it out! It breaks when any() is used, for example any() | not_found <: float() | not_found and false | true <: integer() | any() do not hold any more, but this can probably be tweaked somehow.