@@ -250,8 +250,7 @@ defmodule Code do
250250 :ignore_already_consolidated ,
251251 :ignore_module_conflict ,
252252 :infer_signatures ,
253- :relative_paths ,
254- :warnings_as_errors
253+ :relative_paths
255254 ]
256255
257256 @ list_compiler_options [ :no_warn_undefined , :tracers , :parser_options ]
@@ -1563,8 +1562,8 @@ defmodule Code do
15631562
15641563 ## Examples
15651564
1566- Code.compiler_options(warnings_as_errors: true )
1567- #=> %{warnings_as_errors: false }
1565+ Code.compiler_options(infer_signatures: false )
1566+ #=> %{infer_signatures: true }
15681567
15691568 """
15701569 @ spec compiler_options ( Enumerable . t ( { atom , term } ) ) :: % { optional ( atom ) => term }
@@ -1593,6 +1592,12 @@ defmodule Code do
15931592 :elixir_config . get ( key )
15941593 end
15951594
1595+ # TODO: Remove me in Elixir v2.0
1596+ def get_compiler_option ( :warnings_as_errors ) do
1597+ IO . warn ( ":warnings_as_errors is deprecated as part of Code.get_compiler_option/1" )
1598+ :ok
1599+ end
1600+
15961601 @ doc """
15971602 Returns a list with all available compiler options.
15981603
@@ -1647,9 +1652,6 @@ defmodule Code do
16471652 warnings, and errors generated by the compiler. Note disabling this option
16481653 won't affect runtime warnings and errors. Defaults to `true`.
16491654
1650- * `:warnings_as_errors` - causes compilation to fail when warnings are
1651- generated. Defaults to `false`.
1652-
16531655 * `:no_warn_undefined` (since v1.10.0) - list of modules and `{Mod, fun, arity}`
16541656 tuples that will not emit warnings that the module or function does not exist
16551657 at compilation time. Pass atom `:all` to skip warning for all undefined
@@ -1695,6 +1697,16 @@ defmodule Code do
16951697 :ok
16961698 end
16971699
1700+ # TODO: Remove me in Elixir v2.0
1701+ def put_compiler_option ( :warnings_as_errors , value ) do
1702+ IO . warn (
1703+ ":warnings_as_errors is deprecated as part of Code.put_compiler_option/2, " <>
1704+ "pass it as option to Kernel.ParallelCompiler instead"
1705+ )
1706+
1707+ :ok
1708+ end
1709+
16981710 def put_compiler_option ( :no_warn_undefined , value ) do
16991711 if value != :all and not is_list ( value ) do
17001712 raise "compiler option :no_warn_undefined should be a list or the atom :all, " <>
0 commit comments