James_E

James_E

Suppress specific warnings?

In the specific case of Bitwise.bxor/2’s use in a function I have, I find the operator notation more readable than the function notation.

  defp exchange_bits({a, b}, mask) do
    c = (a ^^^ b) &&& mask
    {(a ^^^ c), (b ^^^ c)}
  end

However, the compiler whines about this:

warning: ^^^ is deprecated. It is typically used as xor but it has the wrong precedence, use Bitwise.bxor/2 instead

Obviously, the above code is stable against any upcoming precedence changes… but this warning is blasted out anyway.

Is there any way to suppress this particular warning? I know that, for instance, most Python linters will have directives you can stick in the comments to override their normal behavior within a single line or function without disabling the whole class of warnings. Does Elixir’s built-in linter have anything like that?

Most Liked

hauleth

hauleth

It is not linter, it is compilation warning. And no, Elixir do not allow you to disable deprecation warnings, only undefined warnings can be suppressed.

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement