Skip to content

Commit f187943

Browse files
nicolasstuckiWojciechMazur
authored andcommitted
LambdaType.derivedLambdaType return a LambdaType.This
[Cherry-picked aa2c851]
1 parent d5bdc16 commit f187943

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,7 +3640,7 @@ object Types {
36403640
trait LambdaType extends BindingType with TermType { self =>
36413641
type ThisName <: Name
36423642
type PInfo <: Type
3643-
type This <: LambdaType{type PInfo = self.PInfo}
3643+
type This >: this.type <: LambdaType{type PInfo = self.PInfo}
36443644
type ParamRefType <: ParamRef
36453645

36463646
def paramNames: List[ThisName]
@@ -3698,7 +3698,7 @@ object Types {
36983698

36993699
final def derivedLambdaType(paramNames: List[ThisName] = this.paramNames,
37003700
paramInfos: List[PInfo] = this.paramInfos,
3701-
resType: Type = this.resType)(using Context): LambdaType =
3701+
resType: Type = this.resType)(using Context): This =
37023702
if ((paramNames eq this.paramNames) && (paramInfos eq this.paramInfos) && (resType eq this.resType)) this
37033703
else newLikeThis(paramNames, paramInfos, resType)
37043704

@@ -3817,7 +3817,7 @@ object Types {
38173817
import DepStatus._
38183818
type ThisName = TermName
38193819
type PInfo = Type
3820-
type This <: TermLambda
3820+
type This >: this.type <: TermLambda
38213821
type ParamRefType = TermParamRef
38223822

38233823
override def resultType(using Context): Type =
@@ -4114,7 +4114,7 @@ object Types {
41144114
trait TypeLambda extends LambdaType {
41154115
type ThisName = TypeName
41164116
type PInfo = TypeBounds
4117-
type This <: TypeLambda
4117+
type This >: this.type <: TypeLambda
41184118
type ParamRefType = TypeParamRef
41194119

41204120
def isResultDependent(using Context): Boolean = true

0 commit comments

Comments
 (0)