Skip to content

Commit

Permalink
Backport "LambdaType.derivedLambdaType return a LambdaType.This" …
Browse files Browse the repository at this point in the history
…to LTS (#20657)

Backports #18428 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 20, 2024
2 parents af88b73 + bd5555a commit 5f4cb20
Showing 1 changed file with 4 additions and 4 deletions.
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 @@ -3640,7 +3640,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 @@ -3698,7 +3698,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 @@ -3817,7 +3817,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 @@ -4114,7 +4114,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

0 comments on commit 5f4cb20

Please sign in to comment.