Ununderstandable compilation error that only happens 'sometimes'

26 views
Skip to first unread message

Wiebe-Marten Wijnja

unread,
Jul 7, 2016, 9:24:56 AM7/7/16
to elixir-lang-core
I am working on an Elixir library called Tensor that allows manipulating Vectors/Matrices and higher dimension data grids (i.e. Tensors), which are implemented as a map of maps inside a struct.

All is fine, but ever so often, I suddenly get the following compilation error:

Compiling 4 files (.ex)

== Compilation error on file lib/matrix.ex ==
** (MatchError) no match of right hand side value: []
    (elixir) src/elixir_locals.erl:34: :elixir_locals.local_for/4


This stack trace does not really tell me what is wrong. It seems that something goes wrong inside the file that does the compilation, rather than in the Matrix module.

Now, when I remove the contents of matrix.ex and recompile, the project compiles, but I get some warning about missing module invocations in other parts of the code. This is completely reasonable and understandable behaviour.

Where it becomes strange is, that when I paste back the exact same contents into the matrix.ex file after this, and again recompile, everything works just fine!

So:
1. error on compilation.
2. Remove file contents, recompile.
3. Re-add file contents, recompile.
4. Problem fixed?
(when I try compiling later, the same problem will appear again)

This is a very curious behaviour, and I think it might hint at a bug.
Can someone explain what is going on?


Sincerely,

~Wiebe-Marten

José Valim

unread,
Jul 7, 2016, 9:26:35 AM7/7/16
to elixir-l...@googlegroups.com
A bug that has been fixed on Elixir v1.3.1.

See: https://github.com/elixir-lang/elixir/issues/4840



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0c14432b-cd91-49ca-bdf1-314e506974bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wiebe-Marten Wijnja

unread,
Jul 7, 2016, 9:37:32 AM7/7/16
to elixir-lang-core, jose....@plataformatec.com.br
Thank you for your quick reply!

Glad to hear that this bug is known and fixed. :-)

~Wiebe-Marten
Reply all
Reply to author
Forward
0 new messages