You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmoduleSomeModuledodefdo_something(token)do# Guardian.Token.Jwt is a library module in the guardian library# MyApp.Guardian is a module defined inside my applicationGuardian.Token.Jwt.decode_token(MyApp.Guardian,token)enddefdo_something_elsedoApplication.get_env(:my_app,MyApp.Guardian)endend
Stacktrace / Current Behaviour
After running mix format:
defmoduleSomeModuledoaliasMyApp.Guardiandefdo_something(token)do# elixir now can't find the Guardian.Token.Jwt module because it is# looking for MyApp.Guardian.Token.Jwt which is not a real moduleGuardian.Token.Jwt.decode_token(Guardian,token)enddefdo_something_elsedoApplication.get_env(:my_app,Guardian)endend
The text was updated successfully, but these errors were encountered:
jsw800
changed the title
Alias lifting produces broken code when aliases conflict with other existing usages
bug: alias lifting produces broken code when aliases conflict with other existing usages
Sep 4, 2024
Ah sorry about that - I had kinda changed it from my original code so as to not share my actual source code. It looks like the difference between my original code and the example I shared is that MyApp.Guardian was actually MyApp.Something.Guardian. When the code looks like this, the test fails as expected:
defmoduleSomeModuledo@moduledocfalsedefdo_something(token)do# Guardian.Token.Jwt is a library module in the guardian library# MyApp.Something.Guardian is a module defined inside my applicationGuardian.Token.Jwt.decode_token(MyApp.Something.Guardian,token)enddefdo_something_elsedoApplication.get_env(:my_app,MyApp.Something.Guardian)endend
Versions
Example Input
Before running
mix format
:Stacktrace / Current Behaviour
After running mix format:
The text was updated successfully, but these errors were encountered: