Age | Commit message (Collapse) | Author |
|
|
|
erl_lint has been updated so that it takes the new -export_type()
attribute into account.
This means:
- do not complain about types which are defined but nowhere used in the
module but exported to other modules
- check that all types which are exported are indeed defined in the module
- warn when there are multiple occurrences of exported types.
In doing this change, I've also taken the liberty to introduce many types and
specs for functions of this module and to do small cleanups here and there.
|
|
|
|
|
|
Wrote and changed some tests in stdlib:erl_lint_SUITE
nowarn_bif_clash is obsoleted but will remove warnings and errors about bif
clashes. The recommended way is to use no_auto_import directives instead.
Hopefully erlang.erl is the only user in the world of nowarn_bif_clash.
|
|
Added only a few testcases in compiler:error_SUITE and guard_SUITE
The new behaviour of warnings and errors when overriding autoimported BIF's:
Bifs that were autoimported before R14 are dangerous because old code
using them and overriding them in exports can start behaving
differently. For newly added autoimports this can't happen to the new
code that wants to (or dont want to) use them, why only warnings are
added for the BIFs autoimported after the compilator change. Errors
are issued only for code that could have worked in one way in R13 and
now will behave in a different way.
If overriding autoimport with local function:
- if explicit -compile directive supresses autoimport
-> no message
else
- if called from inside module
- if pre R14 autoimported bif
-> error
else
-> warning
else
-> no message
If overriding autoimport with import directive
- if explicit -compile directive supresses autoimport
-> no message
else (regardless of actual usage)
- if pre R14 autoimported bif
-> error
else
-> warning
Calls of local functions or imports overriding autoimported functions
(either post R14 or by using explicit -compile supressions of
autoimport) always goes to the local function or the imported.
The compileation errors are added to not let code like this silently
and disastrously change its semantic (probably to an infinite loop)
between R13 and R14:
----------
-module(m).
-export([length/1]).
length(X) ->
...
Y = length(Z),
....
----------
The user has to select if he/she wants to call length in 'erlang' explicitly
or if the overriding semantics is desired, in which case the -compile
directive has to be used.
-compile({no_auto_import,[F/A]}). Is added to allow to override the
autoimports so that code gets unanbiguous. The directive will remove
an autoimport even if there is no local function or import overriding,
because any other behaviour would be inconsistent and confusing.
record_info and module_info can never be overridden.
|
|
|
|
Import directives still not sorted out!
|
|
Expressions evaluating to integers can now be used in types and function
specifications where hitherto only integers were allowed
("Erlang_Integer").
|
|
'cond' is an experimental feature that was never completed.
|
|
|
|
* ks/erl_lint:
erl_lint_SUITE: adjust failing test case
Allow recursive types and check for undefined types
OTP-8421: ks/erl_lint
|
|
Contains four kinds of changes:
* Allows recursive types and type definitions to be in any order.
* Because the checking is not performed from top to bottom, there
is a separate pass which checks for undefined module-local types.
* Behaviour callbacks which allow specs in them.
* Clean up the code as suggested by tidier.
|
|
|