Compilation warning about behaviour not existing.
bug
Hi,
I really appreciate this project and am using it where I can.
I have run into an issue where I get a compiler warning (elixir 1.14.0-otp-25) about the generated behaviour not being implemented.
```
warning: @behaviour Service.Effects does not exist (in module Service.Effects)
lib/service.ex:9: Service.Effects (module)
warning: got "@impl Service.Effects" for function write/1 but this behaviour does not specify such callback. There are no known callbacks, please specify the proper @behaviour and make sure it defines callbacks
lib/service.ex:13: Service.Effects (module)
```
Whilst this isn't problematic in itself (everything works), our CI compiles with the flag `--warnings-as-errors` so it fails.
I have included a [effects.zip](https://github.com/user-attachments/files/17700985/effects.zip) but it doesn't deviate much from the examples in the readme.
```
defmodule Service do
alias Service.Effects
def write() do
Effects.write("Hello, World!")
end
end
defmodule Service.Effects do
use Efx
@spec write(String.t()) :: :ok
defeffect write(value) do
File.write!("/tmp/abc.txt", value)
end
end
```
Any help is greatly appreciated.
Thanks
Matt
关闭于 2024-11-12 2 条评论