TypeReprMethods
given TypeReprMethods
Extension methods of TypeRepr
Extensions
Extensions
extension (self: TypeRepr)
The least type instance of given class which is a super-type of this type. Example:
class D[T]
class C extends p.D[Int]
ThisType(C).baseType(D) = p.D[Int]
Is this type a function type?
- Returns
true if the dealised type of
self
without refinement isFunctionN[T1, T2, ..., Tn]
- Note
The function
returns true for
given Int => Int
anderased Int => Int
returns false for
List[Int]
, despite thatList[Int] <:< Int => Int
.
A simplified version of this type which is equivalent wrt =:= to this type. Reduces typerefs, applied match types, and and or types.
Widen from singleton type to its underlying non-singleton
base type by applying one or more underlying
dereferences,
Also go from => T to T.
Identity for all other types. Example:
class Outer { class C ; val x: C }
def o: Outer