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

Deprecated and undefined function warnings point to different places #12995

Closed
josevalim opened this issue Oct 6, 2023 · 2 comments
Closed

Comments

@josevalim
Copy link
Member

Elixir and Erlang/OTP versions

Main

Operating system

Any

Current behavior

This code:

defmodule Foo do
  def bar do
    require Logger
    Logger.warn "OMG"
    Logger.unknown "OMG"
  end
end

emits:

$ elixir foo.exs
    warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
    │
  4 │ Logger.warn "OMG"
    │        ~
    │
    └─ foo.exs:4:8: Foo.bar/0

    warning: Logger.unknown/1 is undefined or private
    │
  5 │ Logger.unknown "OMG"
    │       ~
    │
    └─ foo.exs:5:7: Foo.bar/0

Notice one points to the dot, the other to the function name. Preferences?

Expected behavior

To be decided.

@josevalim
Copy link
Member Author

/cc @viniciusmuller.

@whatyouhide
Copy link
Member

@josevalim my 2c is that the function name is better, since that's the subject of the deprecation. Doesn't really matter though 🙃

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

No branches or pull requests

2 participants