0
votes

I'm a beginner at programming Erlang and at Stack Overflow, so I hope this isn't a very silly question.

I've installed Erlang/OTP 20.1 from the official website, on Windows 10. I'm trying to compile some simple Erlang modules from erl, werl or git bash (from the correct directory), and I get the following error:

3> c(useless).
useless.erl: internal error in beam_asm;
crash reason: undef

in function  maps:size/1
 called as maps:size(#{})
in call from beam_dict:atom/2 (beam_dict.erl, line 88)
in call from beam_asm:assemble/5 (beam_asm.erl, line 65)
in call from beam_asm:module/5 (beam_asm.erl, line 62)
in call from compile:beam_asm/2 (compile.erl, line 1454)
in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 342)
in call from compile:fold_comp/4 (compile.erl, line 369)
in call from compile:internal_comp/5 (compile.erl, line 353)

What do you think is the problem? Exactly the same error appears with each module, no matter where it is saved. The funny thing is that I could compile and run these modules yesterday without a problem, but I got the same problem before yesterday!

Thanks a lot!

Bernat

1
Can you post your source code?Mat
You mean the code of the module I was trying to run?Bernat
Yes, you mentioned this error occurs with every modules. Can you post the code of the simplest module you can come up with and see if this error happens again? (E.g. a module only containing a function that just returns its parameter.)Mat
-module(tut1). -export([fac/1]). fac(1) -> 1; fac(N) -> N* fac(N-1).Bernat

1 Answers

1
votes

Did you create a module called "maps"? In that case, the problem is that you have overridden the standard maps module (which contains the size/1 function) with one that has no such function, hence the "undef".