abstract type pattern is unchecked since it is eliminated by erasure
julien-truffaut opened this issue · comments
I got the following error in scala 2.10 once I upgraded from 1.1.0 to 1.1.1
https://travis-ci.org/julien-truffaut/Monocle/jobs/169164862
Can you point me at the corresponding source?
sure:
https://github.com/julien-truffaut/Monocle/blob/master/macro/shared/src/main/scala/monocle/macros/GenIso.scala#L116-L117
https://github.com/julien-truffaut/Monocle/blob/master/macro/shared/src/main/scala/monocle/macros/Lenses.scala#L58
https://github.com/julien-truffaut/Monocle/blob/master/macro/shared/src/main/scala/monocle/macros/Lenses.scala#L69
https://github.com/julien-truffaut/Monocle/blob/master/macro/shared/src/main/scala/monocle/macros/Lenses.scala#L80
Thanks @milessabin, you're fixed worked :)
For the record the fix (I think it is a fix rather than a workaround) is to use patterns of the form,
case n: TermName => ...
case n: TypeName => ...
rather than,
case n@TermName(_) => ...
case n@TypeName(_) => ...
@milessabin Can you explain why the latter doesn't work in 2.10?
It seems that the extractors are being viewed as non-stable.
Personally I would qualify that as an issue with macro-compat that requires a workaround in user-land.
I wonder what project required support for them in macro-compat in the first place: 83ceac1