Open ityonemo opened 4 years ago
none
be a subtype of all types? "In theory" the answer should be yes. However, what is the correct answer might depend on how agressively none is used to represent crashes? no_return
is the type of something which only tail calls into itself (or raises) and is equivalent to none
. Should integer | no_return
resolve to integer
or stay as integer | no_return
?currently, it's set to not be a subtype of anything (including any)
(5 -> integer) | (4 -> integer)
--> (4..5 -> integer)
(5 -> atom) | (integer -> integer)
--> (integer -> atom | integer)
current strategy is to ignore all required() fields that aren't singleton types.
what happens when you have a map definiton where two type definitions overlap, for example:
%{optional(:pos_integer) => :atom, optional(1..100) => :fizz | :buzz | :fizzbuzz}
what happens if they are disjoint?
%{optional(:pos_integer) => :atom, optional(1..100) => :fizz | :buzz | :fizzbuzz | integer}
what happens if one is required?
%{required(:foo) => :bar, optional(atom) => atom}
this issue will remain open for open questions about erlang types