This page is no longer maintained — Please continue to the home page at www.scala-lang.org

subclass type parameter inference

No replies
Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
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

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland