Regression in Macros?

23 visninger
Gå til det første ulæste opslag

Reto Hablützel

ulæst,
9. nov. 2016, 00.35.4309.11.2016
til ReactiveMongo - http://reactivemongo.org
Hi,

I have just moved from 0.11.14 to 0.12.0. Without modifying any code, we now have warnings such as:
/../package.scala:755: Types are not compatible: securesocial.core.providers.MailToken != reactivemongo.bson.BSONObjectID
[warn]   implicit val TokenHandler = Macros.handler[Token]


The case class Token has a field _id of type BSONObjectID - however where is the MailToken coming from? There is no such field in anywhere in the case class itself.

But the Token case class has a companion object that has an apply method that takes a MailToken as parameter -- so I think it is somehow confusing the apply method in the companion object with the "real" constructor in the case class itself.

We have a number of such warnings that all seem to have an apply method in the companion ojbect in common.


- Reto

Cédric Chantepie

ulæst,
9. nov. 2016, 07.33.1109.11.2016
til ReactiveMongo - http://reactivemongo.org
As these messages are logged as warnings, it means that's not fatal, but not recommended.

It's generally a good practice not to have different apply for case class, save for migration purposes.

Svar alle
Svar til forfatter
Videresend
0 nye opslag