I have this code in an implicit class like this:
object TenorOperations {
implicit class TenorOperations(thiss: Tenor) {
def toDate: LocalDate = thiss match {
case Day(d) => LocalDate.now().plusDays(d)
case Month(m) => LocalDate.now().plusMonths(m)
case Year(y) => LocalDate.now().plusYears(y)
case errorDate => throw new Exception("Unexpected date: "+errorDate)
}
}
}
It just won't compile in IDEA.
Error:(14, 47) implicit numeric widening
case Day(d) => LocalDate.now().plusDays(d)
^
Error:(15, 51) implicit numeric widening
case Month(m) => LocalDate.now().plusMonths(m)
^
Error:(16, 49) implicit numeric widening
case Year(y) => LocalDate.now().plusYears(y)
^
This used to work. How can I fix it?