Skip to content

Conversation

@mhanberg
Copy link
Contributor

Fixes #42

cc @zachdaniel - try this branch out and let me know if it works for you, then I'll merge and publish a patch.

@zachdaniel
Copy link
Contributor

It doesn't appear to work for me.

lib/code/common.ex:200:pattern_match The pattern can never match the type. Pattern: {:ok, _env} Type: :error | %{:attrs => [any()], :functions => _, :macros => _, :variables => [any()], _ => _} ________________________________________________________________________________ lib/code/common.ex:221:unused_fun Function use_alias/2 will never be called. ________________________________________________________________________________ lib/code/common.ex:594:pattern_match The pattern can never match the type. Pattern: {:ok, _env} Type: :error | %{:attrs => [any()], :functions => _, :macros => _, :variables => [any()], _ => _} ________________________________________________________________________________ done (warnings were emitted) Halting VM with exit status 2
@zachdaniel
Copy link
Contributor

wait, hang on, sorry, I tested main not this branch 🤦

@zachdaniel
Copy link
Contributor

Ah, okay so I do still have an error, but the error is essentially on my end. The basic issue is that this env is technically safe to pass to expand_alias, but dialyzer still complains 😆 so I will do something like struct!(Macro.Env, spitfire_cursor_env)

@zachdaniel
Copy link
Contributor

Yep, looks good to me 👍 The type is accurately reflecting the return, and struct(Macro.Env, spitfire_cursor_env) satisfies everything else 👍

@mhanberg mhanberg merged commit 781c108 into main Jun 17, 2024
@mhanberg mhanberg deleted the add-better-types branch June 17, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants