dotty.tools.dotc.core.Types.HKTypeLambda
See theHKTypeLambda companion class
object HKTypeLambda extends TypeLambdaCompanion[HKTypeLambda]
Attributes
- Companion
- class
- Graph
-
- Supertypes
- Self type
-
HKTypeLambda.type
Members list
Value members
Concrete methods
def apply(paramNames: List[TypeName])(paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
def apply(paramNames: List[TypeName], variances: List[Variance])(paramInfosExp: HKTypeLambda => List[TypeBounds], resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
def boundsFromParams[PI <: Of[TypeName]](params: List[PI], bounds: TypeBounds)(using Context): TypeBounds
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
Attributes
Attributes
- Definition Classes
Inherited methods
Attributes
- Inherited from:
- LambdaTypeCompanion
def apply(paramInfos: List[TypeBounds])(resultTypeExp: HKTypeLambda => Type)(using Context): HKTypeLambda
Attributes
- Inherited from:
- LambdaTypeCompanion
def apply(paramNames: List[TypeName], paramInfos: List[TypeBounds], resultType: Type)(using Context): HKTypeLambda
Attributes
- Inherited from:
- LambdaTypeCompanion
Attributes
- Inherited from:
- TypeLambdaCompanion
Attributes
- Inherited from:
- LambdaTypeCompanion
Attributes
- Inherited from:
- TypeLambdaCompanion
In this article