Skip to content
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

LambdaType.derivedLambdaType return a LambdaType.This #18428

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
8 changes: 4 additions & 4 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3680,7 +3680,7 @@ object Types {
trait LambdaType extends BindingType with TermType { self =>
type ThisName <: Name
type PInfo <: Type
type This <: LambdaType{type PInfo = self.PInfo}
type This >: this.type <: LambdaType{type PInfo = self.PInfo}
type ParamRefType <: ParamRef

def paramNames: List[ThisName]
Expand Down Expand Up @@ -3738,7 +3738,7 @@ object Types {

final def derivedLambdaType(paramNames: List[ThisName] = this.paramNames,
paramInfos: List[PInfo] = this.paramInfos,
resType: Type = this.resType)(using Context): LambdaType =
resType: Type = this.resType)(using Context): This =
if ((paramNames eq this.paramNames) && (paramInfos eq this.paramInfos) && (resType eq this.resType)) this
else newLikeThis(paramNames, paramInfos, resType)

Expand Down Expand Up @@ -3857,7 +3857,7 @@ object Types {
import DepStatus._
type ThisName = TermName
type PInfo = Type
type This <: TermLambda
type This >: this.type <: TermLambda
type ParamRefType = TermParamRef

override def resultType(using Context): Type =
Expand Down Expand Up @@ -4154,7 +4154,7 @@ object Types {
trait TypeLambda extends LambdaType {
type ThisName = TypeName
type PInfo = TypeBounds
type This <: TypeLambda
type This >: this.type <: TypeLambda
type ParamRefType = TypeParamRef

def isResultDependent(using Context): Boolean = true
Expand Down