exercism / elixir

Exercism exercises in Elixir.
https://exercism.org/tracks/elixir
MIT License
614 stars 397 forks source link

Rational Numbers "abs"/1 function is colliding with Kernel.abs/1 #1490

Closed jonathan-soifer closed 3 months ago

jonathan-soifer commented 3 months ago

Hi,

I believe the title is self-explanatory 😅

I'm trying to complete the exercise called "Rational Numbers" but I'm getting the following error when running the tests:

We received the following error when we ran your code:

Compiling 1 file (.ex) error: imported Kernel.abs/1 conflicts with local function │ 73 │ def abs(a) do │ ^ │ └─ lib/rational_numbers.ex:73:7: RationalNumbers (module)

== Compilation error in file lib/rational_numbers.ex == ** (CompileError) lib/rational_numbers.ex: cannot compile module RationalNumbers (errors have been logged)

Should we rename this function and the related test?

jonathan-soifer commented 3 months ago

Making the calls to Kernel.abs/1 namespacing them solved this