From bd5555ab321a4394c8d907867dc2dcb330cc34a0 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 21 Aug 2023 09:34:56 +0200 Subject: [PATCH] `LambdaType.derivedLambdaType` return a `LambdaType.This` [Cherry-picked aa2c851f2d75e9395a63b0868a0ee77f655ba293] --- compiler/src/dotty/tools/dotc/core/Types.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index fab9ef637801..0bae5ce07722 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -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] @@ -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) @@ -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 = @@ -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