- Companion:
- class
Value members
Concrete methods
Distributes Lambda inside type bounds. Examples:
Distributes Lambda inside type bounds. Examples:
type T[X] = U becomes type T = [X] -> U
type T[X] <: U becomes type T >: Nothing <: ([X] -> U)
type T[X] >: L <: U becomes type T >: ([X] -> L) <: ([X] -> U)
The variances of regular TypeBounds types, as well as of match aliases
and of opaque aliases are always determined from the given parameters
params
. The variances of other type aliases are determined from
the given parameters only if one of these parameters carries a +
or -
variance annotation. Type aliases without variance annotation
are treated structurally. That is, their parameter variances are
determined by how the parameter(s) appear in the result type.
Examples:
type T[X] >: A // X is invariant type T[X] <: List[X] // X is invariant type T[X] = List[X] // X is covariant (determined structurally) opaque type T[X] = List[X] // X is invariant opaque type T[+X] = List[X] // X is covariant type T[A, B] = A => B // A is contravariant, B is covariant (determined structurally) type T[A, +B] = A => B // A is invariant, B is covariant
Inherited methods
- Inherited from:
- LambdaTypeCompanion
- Inherited from:
- LambdaTypeCompanion