vt-elixir / ja_resource

A behaviour to reduce boilerplate code in your JSON-API compliant Phoenix controllers without sacrificing flexibility.
Other
113 stars 33 forks source link

Elixir 1.6 emits compiler warnings for repeated behaviour definitions #73

Closed novaugust closed 6 years ago

novaugust commented 6 years ago

We have compiler warnings set to error, so this is holding us back from adopting 1.6.

In 1.6, the compiler now warns if two behaviours declare the same callback. Further, it does not care if the two declared behaviours are, in fact, the same behaviour.

This is not considered a bug with Elixir.

Within jaresource, this means the repeated use JaResource.Records and use JaResource.Repo stanzas are throwing out errors. Easiest / quickest thing I could think of: reimplement those __using__ functions to track whether they've already run within a module

alanpeabody commented 6 years ago

Thanks for the report @novaugust.

I don't know when I might have a chance to look at this, so in the meantime a PR from anybody to address this would be very welcome!

novaugust commented 6 years ago

Further discussions in that thread on elixir show that this is actually a bug, yay. Can hope for a quick fix in 1.6.1 if we don't figure it out on jaresource first =)

halfdan commented 6 years ago

@novaugust I don't read this as Jose marking it as a bug - rather just saying it should be documented in the CHANGELOG.

novaugust commented 6 years ago

@novaugust I don't read this as Jose marking it as a bug - rather just saying it should be documented in the CHANGELOG.

Yeah, he changed his mind when he realized it was a new thing from 1.5