From 774955d0d2a44fa8ac5943a14516d54db2b8f6d5 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Mon, 3 Mar 2014 15:27:09 +0100 Subject: Introduce compiler option 'nowarn_deprecated_type' The deprecation of the built-in types dict/0 and so on had as side-effect that it was impossible to switch to dict:dict/2 and so on without getting warnings either in the the previous release (R16B) or the current one (17.0). By including the attribute -compile(nowarn_deprecated_type). in an Erlang source file warnings about deprecated types can be avoided in 17.0. The option can also be given as a compiler flag: erlc +nowarn_deprecated_type file.erl --- lib/stdlib/src/erl_lint.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/stdlib/src/erl_lint.erl') diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 603808328e..1fe0bd5896 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -508,6 +508,9 @@ start(File, Opts) -> {deprecated_function, bool_option(warn_deprecated_function, nowarn_deprecated_function, true, Opts)}, + {deprecated_type, + bool_option(warn_deprecated_type, nowarn_deprecated_type, + true, Opts)}, {obsolete_guard, bool_option(warn_obsolete_guard, nowarn_obsolete_guard, true, Opts)}, @@ -2646,7 +2649,8 @@ check_type({type, La, TypeName, Args}, SeenVars, St) -> St1 = case is_var_arity_type(TypeName) of true -> St; false -> - Obsolete = obsolete_builtin_type(TypePair), + Obsolete = (is_warn_enabled(deprecated_type, St) + andalso obsolete_builtin_type(TypePair)), IsObsolete = case Obsolete of {deprecated, Repl, _} when element(1, Repl) =/= Module -> -- cgit v1.2.3