I\'m digging new scala reflection api and can\'t figure out why the following snippet doesn\'t work as expected. Given hierarchy (tried to simplify as much as I can):
Thanks everyone to feedback. Think, I've found the reason why ClassTag
should be used in pattern matching.
I've managed to find [SI-5143] Pattern matching on abstract types doesn't work, and it's associated commit explains that there should be an instance of ClassTag
to make pattern checkable.
So, yes, I used TypeTag
wrong; in case of pattern matching I should use ClassTag
.