Skip to content

Instantly share code, notes, and snippets.

@kaychaks
Last active September 30, 2015 10:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaychaks/37f81a5cd5f2693a8184 to your computer and use it in GitHub Desktop.
Save kaychaks/37f81a5cd5f2693a8184 to your computer and use it in GitHub Desktop.
// Framework Code
trait X {
type T1
}
trait X1 extends X {
type T1 = SomeConcreteClassT
}
type Module {
type R <: X
}
// My Code
trait MyX1 extends X1
trait MyModule extends Module {
type R = MyX1
}
trait MyImpl extends Module {
def myFunc[T <: X](r : S):Seq[T#T1] = ??? // function implementation which returns SomeConcreteClassT
def main() {
myFunc(s) // No ClassTag available for R#T1
}
}
object MyImplObj extends MyImpl with MyModule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment