Open kubukoz opened 4 years ago
Ha, interesting. I guess the two annotations are competing on adding the companion object 🤔
yup ran into this a bunch before, real annoying could never figure out a workaround.
But the tests are full of such algebras with two annotations and no companion objects: https://github.com/typelevel/cats-tagless/blob/master/tests/src/test/scala/cats/tagless/tests/autoFunctorKTests.scala
Could it be something related to incremental compilation? Can you try to clean and compile again?
I forgot to mention but it works when its within another object, another reason why it was so annoying to figure it out. If you move one of those traits with two annotations to the top level of the file, it won't work, IIRC.
Good old bug: https://github.com/scalameta/scalameta/issues/1046, this is to be fixed in scalac (paradise was merged in 2.13)
Would this fix the problem? scala/scala#9555
This will result in
java.lang.NoClassDefFoundError: Foo$
. Uncommenting the companion object fixes things.