Closed coltfred closed 6 years ago
This isn't a defect in newtypes, but seems to be a problem with the underlying pattern. A manual encoding of the Impl
pattern seems to have the same issue. I'd love to hear if @alexknvl has any thoughts on it, regardless.
@alexknvl Even though this isn't an issue directly with newtypes, if you have some ideas about ways to tackle the problem I'd love to hear them.
@coltfred
Replace eq
with eqv
above ;)
EDIT: that only partially solves the issue. Looking into Bar.Foo
Nvm, seems to work fine. https://scalafiddle.io/sf/ZE4LvnK/0
Well, either I'm crazy or something was fixed in a minor release of Scala (not sure what version I was testing on before). Sorry for the bother.
I created a newtype as follows:
As you can see from my comments, the implicits for Eq and Show both work in the scope they were defined. However, if I try and import the implicits, it cannot find the one for Eq.
The error I get if I turn on log-implicits is this:
Any idea why this is happening or work arounds for it?