Join GitHub today
Cascading: improve handling of generic methods #142
For a generic method returning a type parameter having a lower bound, cascading currently creates and returns an instance of this lower bound type. This in most cases will cause a ClassCastException in client code. This issue can be avoided by a) creating an instance of the correct type, if it's given by a "Class" argument in the same call; or b) returning null if the correct subtype to return cannot be determined.