Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
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.