OvermindDL1 / protocol_ex

Elixir Extended Protocol
https://hex.pm/packages/protocol_ex
49 stars 5 forks source link

Return of the aliases #13

Closed jjl closed 6 years ago

jjl commented 6 years ago

Elixir becomes unaware that an alias in the enclosing scope of a defimplEx is used now:

alias Bricks.Connector
alias Bricks.Connector.Tcp
defimplEx TcpConnector, %Tcp{}, for: Connector do

Gives these warnings:

warning: unused alias Connector
  lib/connectors/tcp.ex:4
warning: unused alias Tcp
  lib/connectors/tcp.ex:5

I haven't tried, but I expect this applies to defprotocolEx too

OvermindDL1 commented 6 years ago

Ooo that is because the module is generated 'out of band', hmm, how to use it... Just add a dummy nop expression I guess since I can't access the prior functions to mark them as used...

jjl commented 6 years ago

Yeah, I figured this one might be out of your control :)

OvermindDL1 commented 6 years ago

Nah, I can fix it, I'll just need to generate some dummy code since apparently Elixir's compiler doesn't mark things as used with recursive compile calls. ^.^;

If you'll be able to test it here soon? It's harder to get warnings in tests without resorting to compilation inside tests and such annoyances (though I really should set that up...). :-)

jjl commented 6 years ago

Sure, I can test pretty quickly

OvermindDL1 commented 6 years ago

Alright, can you give it a try from master real quick? You can just comment out the current dep and put in {:protocol_ex, github: "overminddl1/protocol_ex"} for now, this may require some rapid iteration, if you are on irc you can talk to me there, hopping on to my bouncer now. :-)

OvermindDL1 commented 6 years ago

And confirmed fixed on IRC, closing in 0b35e8b. :-)

OvermindDL1 commented 6 years ago

Aaaand maybe not fixed, re-opening...

OvermindDL1 commented 6 years ago

How's master acting for you?

jjl commented 6 years ago

Confirmed fixed