- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
subclass type parameter inference
Sat, 2010-06-12, 15:56
I've been struggling with a solution to a simple problem - Inferring the type parameter to a parent class while retaining a type for the subclass. My toy example is I have a Foo[X] <: Traversable[Y]. I'd like to have type aliases for Foo[X] and Y, while interacting with the thing as if it was a Traversable[Y]. I recently discovered a rather hacky solution: split the inference into two function calls. I was wondering if anyone has any ideas on how to do this all in one go, or if there are plans in the type inference algorithm to do so.
Thanks so much!
- Josh
Thanks so much!
- Josh