Closed samsondav closed 5 years ago
@samphilipd does that still happen if you put the @decorate
above the @impl
?
Yes. Have tried both ways around.
Can you provide a full testcase? Tried it with the following but it does not cause warnings:
defmodule DecoratorImplTest.Fixture.MyDecorator do
use Decorator.Define, some_decorator: 0
def some_decorator(body, _context) do
body
end
end
defmodule DecoratorImplTest.Fixture.MyModule do
use DecoratorImplTest.Fixture.MyDecorator
use GenServer
@impl true
@decorate some_decorator()
def init(value) do
{:ok, value}
end
@impl true
@decorate some_decorator()
def handle_call(_, _, _) do
{:noreply, 1, 1}
end
end
defmodule DecoratorImplTest.Basic do
use ExUnit.Case
alias DecoratorImplTest.Fixture.MyModule
test "impl decoration" do
assert {:ok, 1} = MyModule.init(1)
end
end
Please reopen if this is still relevant.
Elixir 1.5 introduces the
@impl true
directive to declare functions as callback implementations of a behaviour.These declarations don't work with the
@decorate
macro. Example: