Skip to content

Conversation

milmazz
Copy link
Member

@milmazz milmazz commented Jun 23, 2018

The idea behind this PR is avoid this kind of warnings under Elixir 1.7.0-dev:

λ mix test
Compiling 3 files (.ex)
Excluding tags: [no_formatter: true]

..warning: Kernel.Typespec.beam_specs/1 is deprecated, please use Code.Typespec.fetch_specs/1 instead
  (elixir) lib/kernel/typespec.ex:48: Kernel.Typespec.beam_specs/1
  (ex_doc) lib/ex_doc/retriever.ex:481: ExDoc.Retriever.get_specs/1
  (ex_doc) lib/ex_doc/retriever.ex:195: ExDoc.Retriever.get_module_info/2
  (ex_doc) lib/ex_doc/retriever.ex:166: ExDoc.Retriever.generate_node/3
  (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
  (ex_doc) lib/ex_doc/retriever.ex:116: ExDoc.Retriever.docs_from_modules/2
  test/ex_doc/formatter/epub/templates_test.exs:30: ExDoc.Formatter.EPUB.TemplatesTest.get_module_page/1
  test/ex_doc/formatter/epub/templates_test.exs:66: ExDoc.Formatter.EPUB.TemplatesTest."test module_page outputs summaries"/1
  (ex_unit) lib/ex_unit/runner.ex:312: ExUnit.Runner.exec_test/1
  (stdlib) timer.erl:166: :timer.tc/1
  (ex_unit) lib/ex_unit/runner.ex:251: anonymous fn/4 in ExUnit.Runner.spawn_test/3


# Since Elixir 1.7.0-dev, functions from Kernel.Typespec related with the
# runtime aspects, such as reading from .beam files, were moved to Code.Typespec
if Version.compare(System.version(), "1.7.0-dev") == :lt do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer using if Code.ensure_loaded?(Code.Typespec) do as the condition instead.

@michalmuskala michalmuskala merged commit 4dfd27e into master Jun 23, 2018
@michalmuskala michalmuskala deleted the avoid_warnings_after_split_of_kernel_typespec branch June 23, 2018 07:17
@michalmuskala
Copy link
Member

Thank you! ❤️

@michalmuskala
Copy link
Member

@milmazz I'm sorry for merging it and not waiting for you. It was mostly out of the habit and that big green button is so appealing 😅

@milmazz
Copy link
Member Author

milmazz commented Jun 23, 2018

@michalmuskala Don't worry at all. Thanks for the feedback btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants