-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Compilation warning when using super
with unused, overridable function via using
module
#14094
Comments
To reproduce:
def load(nil), do: {:ok, nil}
|
Does it work if you change |
@josevalim I followed these steps:
To this:
When I run |
Thank you. We need to decide to not emit these warnings for overriddable functions (that may be the best option) or to generated ones. |
@acco I believe you forgot |
@josevalim Ah, that's right! I was using |
Just so you know, we decided to fix this without requiring you to annotate them as |
@josevalim Very cool, thank you! ❤️ |
Elixir and Erlang/OTP versions
Elixir 1.18.0 (compiled with Erlang/OTP 27)
Operating system
MacOS Sequoia 15.1.1 (24B91)
Current behavior
Thanks for a great release!
When
using
a library withsuper
, this implementation:Results in a compilation error:
The compilation error goes away if I call
super/1
in the firstload/1
:The library defines two overridable
load/1
functions:So, it appears I need to use both overridable functions in order to not get a compilation warning.
Expected behavior
Because I don't "own" the module I'm
using
, I'd expect the compiler to not care that one of the clauses is unused?The text was updated successfully, but these errors were encountered: