SAMType

object SAMType

An extractor for single abstract method types. A type is a SAM type if it is a reference to a class or trait, which

  • has a single abstract method with a method type (ExprType and PolyType not allowed!) whose result type is not an implicit function type
  • can be instantiated without arguments or with just () as argument.

The pattern SAMType(sam) matches a SAM type, where sam is the type of the single abstract method.

class Object
trait Matchable
class Any

Value members

Concrete methods

def unapply(tp: Type)(using Context): Option[MethodType]
def zeroParamClass(tp: Type)(using Context): Type