diff options
author | Björn Gustavsson <[email protected]> | 2016-08-11 12:56:06 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-02 14:24:36 +0200 |
commit | 8a04dd4dd2d479efe488b0bed118e10559835fb6 (patch) | |
tree | 26a67662082f018a3c5a556b5ae6868f9775817e /lib/debugger/test | |
parent | 0e7c0d4eb8dd8f6f9a9ee377fa886edbae0b1627 (diff) | |
download | otp-8a04dd4dd2d479efe488b0bed118e10559835fb6.tar.gz otp-8a04dd4dd2d479efe488b0bed118e10559835fb6.tar.bz2 otp-8a04dd4dd2d479efe488b0bed118e10559835fb6.zip |
Don't crash when obsolete guard overrides local function
The compiler would crash in v3_codegen when trying to compile the
following code:
is_port(_) -> false.
foo(P) when port(P) -> ok.
We *could* have the compiler interpret the code as:
is_port(_) -> false.
foo(P) when erlang:is_port(P) -> ok.
But that would encourage using the obsolete form of the guard tests.
Note that the following code is illegal:
is_port(_) -> false.
foo(P) when is_port(P) -> ok.
It produces the following diagnostic:
call to local/imported function is_port/1 is illegal in guard
Therefore, we should refuse to compile the code.
Diffstat (limited to 'lib/debugger/test')
0 files changed, 0 insertions, 0 deletions