Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@spec module attribute no longer accessible in 1.7 #8085

Closed
nkezhaya opened this issue Aug 15, 2018 · 3 comments
Closed

@spec module attribute no longer accessible in 1.7 #8085

nkezhaya opened this issue Aug 15, 2018 · 3 comments

Comments

@nkezhaya
Copy link

nkezhaya commented Aug 15, 2018

Current behavior

defmodule Foo do
  @spec x() :: integer()
  def x(), do: 5
  def spec(), do: @spec
end

iex> Foo.spec() #=> nil

Expected behavior

iex> Foo.spec() #=>
[
  {:spec, {:::, [line: 2], [{:x, [line: 2], nil}, {:integer, [line: 2], []}]},
   {Foo, {2, 1}}}
]
@paulperegud
Copy link

paulperegud commented Aug 15, 2018

I was accessing @spec via Module.get_attribute(__MODULE__, :spec) in defmacro __before_compile__(_). Same observations.

@koudelka
Copy link
Contributor

also would love a fix for this, my precious behaves_like is broken 😭

@wende
Copy link
Contributor

wende commented Sep 26, 2018

Same here - type-checking of foreign function interface to Elixir in Elchemy relies on it

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

No branches or pull requests

5 participants