diff options
author | Ilya Klyuchnikov <ilya.klyuchnikov@gmail.com> | 2022-02-12 22:43:45 +0000 |
---|---|---|
committer | Ilya Klyuchnikov <ilya.klyuchnikov@gmail.com> | 2022-02-13 01:49:05 +0000 |
commit | 14a485ca0d0b0afc5218eb52b16e6a3e19a89274 (patch) | |
tree | b7970b26959a04bc0f67130130f3065dd61e4f51 /lib/stdlib/test | |
parent | 9e381125bbd93dfa2f17d4954b54aead749bf012 (diff) | |
download | erlang-14a485ca0d0b0afc5218eb52b16e6a3e19a89274.tar.gz |
allow custom attributes everywhere
This makes Erlang surface syntax more friendly to tooling
like formatters, linters, analyzers.
Currently, the `-dialyzer(...)` attribute is the only annotating
(that is, not affecting semantics) attribute that can be placed
everywhere.
There is no reason to ban other custom attributes
from being placed between functions.
The logic that certain `erlc` attributes cannot be placed
after functions is preserved
This also closes #5689.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 7e89b5f891..3f7e67760f 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -3643,7 +3643,7 @@ basic_errors(Config) -> <<"f() -> ok. -attr(x).">>, [], - {errors,[{{2,17},erl_lint,{attribute,attr}}],[]}}, + []}, {redefine_function, <<"f() -> ok. @@ -4280,12 +4280,9 @@ stacktrace_syntax(Config) -> otp_14285(Config) -> %% A small sample of all the errors and warnings in module erl_lint. E1 = {redefine_function,{'кирилли́ческий атом',0}}, - E2 = {attribute,'кирилли́ческий атом'}, E3 = {undefined_record,'кирилли́ческий атом'}, E4 = {undefined_bittype,'кирилли́ческий атом'}, "function 'кирилли́ческий атом'/0 already defined" = format_error(E1), - "attribute 'кирилли́ческий атом' after function definitions" = - format_error(E2), "record 'кирилли́ческий атом' undefined" = format_error(E3), "bit type 'кирилли́ческий атом' undefined" = format_error(E4), Ts = [{otp_14285_1, @@ -4301,9 +4298,7 @@ otp_14285(Config) -> -'кирилли́ческий атом'(a). "/utf8>>, [], - {errors, - [{{2,16},erl_lint,E2}], - []}}, + []}, {otp_14285_3, <<"'кирилли́ческий атом'() -> #'кирилли́ческий атом'{}. "/utf8>>, |