Skip to content

Commit 404b53b

Browse files
authored
Fix spec and example for Code.compiler_options/1 (#12603)
1 parent 02d6b24 commit 404b53b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/elixir/lib/code.ex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,13 +1463,15 @@ defmodule Code do
14631463
options and for a description of all options, see
14641464
`put_compiler_option/2`.
14651465
1466+
Returns a map with previous values.
1467+
14661468
## Examples
14671469
1468-
Code.compiler_options()
1469-
#=> %{debug_info: true, docs: true, ...}
1470+
Code.compiler_options(warnings_as_errors: true)
1471+
#=> %{warnings_as_errors: false}
14701472
14711473
"""
1472-
@spec compiler_options(Enumerable.t()) :: %{optional(atom) => boolean}
1474+
@spec compiler_options(Enumerable.t({atom, term})) :: %{optional(atom) => term}
14731475
def compiler_options(opts) do
14741476
for {key, value} <- opts, into: %{} do
14751477
previous = get_compiler_option(key)

0 commit comments

Comments
 (0)