Skip to content
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

Styler 0.11.2 locks up when encountering @spec or @callback for a function called ‘import’ #115

Closed
kerryb opened this issue Jan 8, 2024 · 3 comments · Fixed by #116

Comments

@kerryb
Copy link

kerryb commented Jan 8, 2024

Versions

  • Elixir: Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]; Elixir 1.16.0 (compiled with Erlang/OTP 26)
  • Styler: locked at 0.11.2 (styler) 363f4124

Example Input

defmodule Foo do
  @spec import(any(), any(), any()) :: any()
  def import(a, b, c), do: nil
end

Stacktrace / Current Behaviour

mix format foo.ex locks up and never completes.

This is new in 0.11.2, and wasn’t an issue in 0.11.1. Having finally narrowed it down from “formatting the whole project locks up” to realising it was the function name, I appreciate that calling an elixir function import is probably not a great idea. The built-in import/2 is a Kernel function rather than a reserved word though, so it is valid. At least I can easily get my project formatting again by just choosing a better name :-)

@novaugust
Copy link
Contributor

thanks as always for the writeup kerry. i'll see what i can find

@novaugust
Copy link
Contributor

Fixed in 0.11.3, thanks again =)

@kerryb
Copy link
Author

kerryb commented Jan 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants