Skip to content

Remove reflect.LambdaType #10548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* +- ThisType
* +- RecursiveThis
* +- RecursiveType
* +- LambdaType -+- MethodType
* | +- PolyType
* | +- TypeLambda
* +- MethodType
* +- PolyType
* +- TypeLambda
* +- TypeBounds
* +- NoPrefix
*
Expand Down Expand Up @@ -2847,7 +2847,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>

/** Methods of the module object `val ParamRef` */
trait ParamRefModule { this: ParamRef.type =>
def unapply(x: ParamRef): Option[(LambdaType, Int)]
def unapply(x: ParamRef): Option[(TypeRepr, Int)]
}

/** Makes extension methods on `ParamRef` available without any imports */
Expand All @@ -2859,7 +2859,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
/** Extension methods of `ParamRef` */
trait ParamRefMethods:
extension (self: ParamRef):
def binder: LambdaType
def binder: TypeRepr
def paramNum: Int
end extension
end ParamRefMethods
Expand Down Expand Up @@ -2966,12 +2966,8 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
end extension
end RecursiveTypeMethods

// TODO: remove LambdaType and use union types (MethodType | PolyType | TypeLambda)
/** Common abstraction for lambda types (MethodType, PolyType and TypeLambda). */
type LambdaType <: TypeRepr

/** Type of the definition of a method taking a single list of parameters. It's return type may be a MethodType. */
type MethodType <: LambdaType
type MethodType <: TypeRepr

/** `TypeTest` that allows testing at runtime in a pattern match if a `TypeRepr` is a `MethodType` */
given MethodTypeTypeTest as TypeTest[TypeRepr, MethodType] = MethodTypeTypeTestImpl
Expand Down Expand Up @@ -3007,7 +3003,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
end MethodTypeMethods

/** Type of the definition of a method taking a list of type parameters. It's return type may be a MethodType. */
type PolyType <: LambdaType
type PolyType <: TypeRepr

/** `TypeTest` that allows testing at runtime in a pattern match if a `TypeRepr` is a `PolyType` */
given PolyTypeTypeTest as TypeTest[TypeRepr, PolyType] = PolyTypeTypeTestImpl
Expand Down Expand Up @@ -3041,7 +3037,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
end PolyTypeMethods

/** Type of the definition of a type lambda taking a list of type parameters. It's return type may be a TypeLambda. */
type TypeLambda <: LambdaType
type TypeLambda <: TypeRepr

/** `TypeTest` that allows testing at runtime in a pattern match if a `TypeRepr` is a `TypeLambda` */
given TypeLambdaTypeTest as TypeTest[TypeRepr, TypeLambda] = TypeLambdaTypeTestImpl
Expand Down