elixir icon indicating copy to clipboard operation
elixir copied to clipboard

`@behaviour` and `@impl` should add runtime dependency

Open wojtekmach opened this issue 3 years ago • 5 comments

Elixir and Erlang/OTP versions

main

Operating system

macOS

Current behavior

Currently @behaviour adds a compile-time dependency. It doesn't change code being compiled it just emits a warning. And so it can be a runtime dependency and handled in a group pass.

Expected behavior

@behaviour should add a runtime dependency.

wojtekmach avatar Jun 30 '22 20:06 wojtekmach

@marcandre you may like this one. :) Thank you for this and other Hex.pm PRs around re-compilation!

wojtekmach avatar Jun 30 '22 20:06 wojtekmach

This is a tricky one but I will be glad to sit and discuss @marcandre if you are interested!

josevalim avatar Jun 30 '22 20:06 josevalim

It makes sense that checking of behaviour match can be done outside of both the implementation and the spec files, I should have thought of that.

I can definitely have a look at it, even though it seems pretty intimidating 😅

marcandre avatar Jun 30 '22 21:06 marcandre

I shot you an email in case you want to jump into a call!

josevalim avatar Jun 30 '22 21:06 josevalim

~Ah, passing a behaviour to defoverridable/1 / Module.make_overridable will now have to introduce a compile-time dependency.~ Nevermind, it already has to...

marcandre avatar Jul 03 '22 04:07 marcandre