- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Accessing type parameter of a type parameter?
Sun, 2011-01-02, 23:06
hi,
more type questions.... is there any way to reduce the number of type parameters in A from two to one?
trait Rate
trait B[ R <: Rate ]
trait A[ R <: Rate, C <: B[ R ]] {
def x : A[ R, B[ R ]]
}
like
trait Rate
trait B[ R <: Rate ] {
type Ra = R
}
trait A[ C <: B[ _ <: Rate ]] {
def x : A[ B[ C.Ra ]] // C.Ra not possible :(
}
only that C.Ra doesn't work, as C is a type and not an object.
that is, is there no way to refer to a type parameter of a type?
thanks, -sciss-
> trait A[ C <: B[ _ <: Rate ]] {
> def x : A[ B[ C.Ra ]] // C.Ra not possible :(
> }
C#Ra should work.
Michael