Gradualizer icon indicating copy to clipboard operation
Gradualizer copied to clipboard

Define subtyping of unions with type difference

Open erszcz opened this issue 1 year ago • 1 comments

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.

erszcz avatar May 31 '24 08:05 erszcz

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.

xxdavid avatar Jun 01 '24 13:06 xxdavid