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
Curious about ex_type run on a little demo app I'm trying to put together for a talk I'm giving this Tuesday about opaque types in Elixir.
The repo is here https://github.com/erlandsona/opaque
when I run mix type I get this output
❌ Controller.handle/1
|
| type error for Email._/1 with Email._(%Phone{_: bitstring()} | %Email{_: bitstring()} | %Address{city: bitstring(), state: %St{_: :washington | :tennessee | :oregon | :new_york | :colorado}, street: bitstring(), unit: nil | bitstring()})
|
| at ~/code/messin/lib/contact.ex:132
❌ Controller.handle/1
|
| type error for Address.format/1 with Address.format(%Phone{_: bitstring()} | %Email{_: bitstring()} | %Address{city: bitstring(), state: %St{_: :washington | :tennessee | :oregon | :new_york | :colorado}, street: bitstring(), unit: nil | bitstring()})
|
| at ~/code/messin/lib/contact.ex:131
What that's telling me is ex_type is not using pattern matching to allow the subset of a union type to pass down as just it's branch. Curious if exhaustiveness checking is implemented and if so, whether or not it supports this use case, why or why not?
The text was updated successfully, but these errors were encountered:
It's because ex_type did not have well support with union type + pattern match for multi-clauses function case. Some basic support (include basic exhaustiveness checking) should be added via #11 . Some advanced case would be traced at #12 .
Basic support should be able to address the case (Controller.handler/1) in this issue.
Curious about ex_type run on a little demo app I'm trying to put together for a talk I'm giving this Tuesday about opaque types in Elixir.
The repo is here
https://github.com/erlandsona/opaque
when I run
mix type
I get this outputWhat that's telling me is ex_type is not using pattern matching to allow the subset of a union type to pass down as just it's branch. Curious if exhaustiveness checking is implemented and if so, whether or not it supports this use case, why or why not?
The text was updated successfully, but these errors were encountered: