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
Is your feature request related to a problem? Please describe.
One of the features we are exploring for Elixir's type system, which could also apply to TypeSpecs and Dialyzer, is witness generation. If a function call fails due to types, we can generate a value that reproduces the failure at runtime. While we can generate witnesses for most runtime values, the issue arises with pids and ports (and slightly with refs).
Describe the solution you'd like
I could call open_port({spawn, "true"}, []) or spawn(fun() -> ok end) to generate values, but it would be best if we could have a safe deterministic value we could emit. One potential suggestion is to always count from 1, and leave pid(0, 0, 0), port(0, 0) and ref(0, 0, 0, 0) always unused.
Additional context
Given this may be useful in other contexts, I have decided to open up an issue to see if there is any interest on this change. However, feel free to close this if undesired, as I do have a workaround for now. :)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
One of the features we are exploring for Elixir's type system, which could also apply to TypeSpecs and Dialyzer, is witness generation. If a function call fails due to types, we can generate a value that reproduces the failure at runtime. While we can generate witnesses for most runtime values, the issue arises with pids and ports (and slightly with refs).
Describe the solution you'd like
I could call
open_port({spawn, "true"}, [])
orspawn(fun() -> ok end)
to generate values, but it would be best if we could have a safe deterministic value we could emit. One potential suggestion is to always count from 1, and leavepid(0, 0, 0)
,port(0, 0)
andref(0, 0, 0, 0)
always unused.Additional context
Given this may be useful in other contexts, I have decided to open up an issue to see if there is any interest on this change. However, feel free to close this if undesired, as I do have a workaround for now. :)
The text was updated successfully, but these errors were encountered: