No line number on Compiler Error

I receive the following error from the compiler. How do I know where this is occurring in my program?

Compiling 1 file (.ex)
** (ArithmeticError) bad argument in arithmetic expression
:erlang./(:ok, 0)

1 Like

Wow… This looks strange.

Since you do get it during compilation, I’d guess it is during some macro-magic, but thats really only a guess.

To debug something like this, you could now comment all your functions in that file, and compile. Uncomment a single function, recompile, uncomment another, recompile…

When you reintroduce the error you know which function you have to inspect. Start there to comment the body and then uncomment it line by line, recompiling each time as above.

1 Like