Skip to content

Commit 2422339

Browse files
committed
Do no infer signatures on Elixir first pass
1 parent 219bcc9 commit 2422339

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ $(KERNEL): lib/elixir/src/* lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex lib/elixir
9595
echo "==> bootstrap (compile)"; \
9696
$(ERL) -s elixir_compiler bootstrap -s erlang halt; \
9797
"$(MAKE)" unicode; \
98+
cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin --no-infer-signatures; \
99+
else \
100+
@ echo "==> elixir (compile)"; \
101+
$(Q) cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin; \
98102
fi
99-
@ echo "==> elixir (compile)";
100-
$(Q) cd lib/elixir && ../../$(ELIXIRC) "lib/**/*.ex" -o ebin;
101103

102104
$(APP): lib/elixir/src/elixir.app.src lib/elixir/ebin VERSION $(GENERATE_APP)
103105
$(Q) $(GENERATE_APP) $(VERSION)

bin/elixirc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Usage: $(basename "$0") [elixir switches] [compiler switches] [.ex files]
1212
--ignore-module-conflict Does not emit warnings if a module was previously defined
1313
--no-debug-info Does not attach debug info to compiled modules
1414
--no-docs Does not attach documentation to compiled modules
15+
--no-infer-signatures Does not infer signatures for compiled modules
1516
--profile time Profile the time to compile modules
1617
--verbose Prints compilation status
1718
--warnings-as-errors Treats warnings as errors and return non-zero exit status

bin/elixirc.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ echo.
2121
echo --ignore-module-conflict Does not emit warnings if a module was previously defined
2222
echo --no-debug-info Does not attach debug info to compiled modules
2323
echo --no-docs Does not attach documentation to compiled modules
24+
echo --no-infer-signatures Does not infer signatures for compiled modules
2425
echo --profile time Profile the time to compile modules
2526
echo --verbose Prints compilation status
2627
echo --warnings-as-errors Treats warnings as errors and returns non-zero exit status

lib/elixir/lib/kernel/cli.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ defmodule Kernel.CLI do
320320
parse_argv(t, %{config | compiler_options: compiler_options})
321321
end
322322

323+
defp parse_argv([~c"--no-infer-signatures" | t], %{mode: :elixirc} = config) do
324+
parse_argv(t, %{
325+
config
326+
| compiler_options: [{:infer_signatures, false} | config.compiler_options]
327+
})
328+
end
329+
323330
defp parse_argv([~c"--ignore-module-conflict" | t], %{mode: :elixirc} = config) do
324331
compiler_options = [{:ignore_module_conflict, true} | config.compiler_options]
325332
parse_argv(t, %{config | compiler_options: compiler_options})

0 commit comments

Comments
 (0)