-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typer #245
Comments
I've used typer with erlang, but as far as I know it only accepts erlang source files as inputs. We're able to use dialyzer because it also accepts compiled BEAM files. This does not mean it is impossible - we can decompile Elixir BEAM files to Erlang source, and then run typer on it and then parse and pretty print the output. That is a lot more tractable now that we have erlex, and maybe would be worth exploring. |
I think the reason this would be difficult is because the dialyzer produces I had this idea a while ago and did some exploration. It's pretty easy to match on erl_types because they're just tuples. I did some conversion in https://github.com/the-mikedavis/ex_types and saw some good results, but it's nowhere near general-purpose yet. I also had the thought about what the typer should produce for Elixir. Printing out strings is fine if we can give a line number where they should go, but it feels like we're missing the opportunity to cash in on quoted forms. If we can parse erl_types into quoted forms then we have a much better shot at injecting the spec into the right place automatically. Plus we get safe formatting for free from core Elixir. I tried this a bit in https://github.com/the-mikedavis/spectre, but, again, it's far from general purpose. Given that I'm hooking into dialyxir's PLT, I'd be happy to fold in my work from spectre into dialyxir once it seems to work in general 😄 |
Erlex should be able to run with that just fine. If you find a place to hook it in, it should be as simple as calling |
Along with
dialyzer
, there'styper
which prints@spec
s for all functions.I couldn't find anything for this and was wondering if you had any plans to add it.
The text was updated successfully, but these errors were encountered: