From 26497bb3c654e294a48db2098978bc77b11f2889 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 17 Mar 2017 15:51:19 +0100 Subject: Rename PolyTypeTree -> LambdaTypeTree --- compiler/src/dotty/tools/dotc/typer/Namer.scala | 6 +++--- compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala | 2 +- compiler/src/dotty/tools/dotc/typer/Typer.scala | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/typer') diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 3c00d6598..54e9af593 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -298,7 +298,7 @@ class Namer { typer: Typer => val inSuperCall1 = if (tree.mods is ParamOrAccessor) EmptyFlags else inSuperCall // suppress inSuperCall for constructor parameters val higherKinded = tree match { - case TypeDef(_, PolyTypeTree(_, _)) if isDeferred => HigherKinded + case TypeDef(_, LambdaTypeTree(_, _)) if isDeferred => HigherKinded case _ => EmptyFlags } @@ -795,7 +795,7 @@ class Namer { typer: Typer => myTypeParams = { implicit val ctx = nestedCtx val tparams = original.rhs match { - case PolyTypeTree(tparams, _) => tparams + case LambdaTypeTree(tparams, _) => tparams case _ => Nil } completeParams(tparams) @@ -1169,7 +1169,7 @@ class Namer { typer: Typer => val isDerived = tdef.rhs.isInstanceOf[untpd.DerivedTypeTree] val rhs = tdef.rhs match { - case PolyTypeTree(_, body) => body + case LambdaTypeTree(_, body) => body case rhs => rhs } val rhsBodyType = typedAheadType(rhs).tpe diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index 14d4f315d..0edb22b06 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -459,7 +459,7 @@ trait TypeAssigner { tree.withType(ownType) } - def assignType(tree: untpd.PolyTypeTree, tparamDefs: List[TypeDef], body: Tree)(implicit ctx: Context) = + def assignType(tree: untpd.LambdaTypeTree, tparamDefs: List[TypeDef], body: Tree)(implicit ctx: Context) = tree.withType(body.tpe.LambdaAbstract(tparamDefs.map(_.symbol))) def assignType(tree: untpd.ByNameTypeTree, result: Tree)(implicit ctx: Context) = diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 37f43f21c..8bde5e4e3 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1096,12 +1096,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } } - def typedPolyTypeTree(tree: untpd.PolyTypeTree)(implicit ctx: Context): Tree = track("typedPolyTypeTree") { - val PolyTypeTree(tparams, body) = tree + def typedLambdaTypeTree(tree: untpd.LambdaTypeTree)(implicit ctx: Context): Tree = track("typedLambdaTypeTree") { + val LambdaTypeTree(tparams, body) = tree indexAndAnnotate(tparams) val tparams1 = tparams.mapconserve(typed(_).asInstanceOf[TypeDef]) val body1 = typedType(tree.body) - assignType(cpy.PolyTypeTree(tree)(tparams1, body1), tparams1, body1) + assignType(cpy.LambdaTypeTree(tree)(tparams1, body1), tparams1, body1) } def typedByNameTypeTree(tree: untpd.ByNameTypeTree)(implicit ctx: Context): ByNameTypeTree = track("typedByNameTypeTree") { @@ -1262,10 +1262,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val TypeDef(name, rhs) = tdef completeAnnotations(tdef, sym) val rhs1 = tdef.rhs match { - case rhs @ PolyTypeTree(tparams, body) => + case rhs @ LambdaTypeTree(tparams, body) => val tparams1 = tparams.map(typed(_)).asInstanceOf[List[TypeDef]] val body1 = typedType(body) - assignType(cpy.PolyTypeTree(rhs)(tparams1, body1), tparams1, body1) + assignType(cpy.LambdaTypeTree(rhs)(tparams1, body1), tparams1, body1) case rhs => typedType(rhs) } @@ -1555,7 +1555,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit case tree: untpd.OrTypeTree => typedOrTypeTree(tree) case tree: untpd.RefinedTypeTree => typedRefinedTypeTree(tree) case tree: untpd.AppliedTypeTree => typedAppliedTypeTree(tree) - case tree: untpd.PolyTypeTree => typedPolyTypeTree(tree)(localContext(tree, NoSymbol).setNewScope) + case tree: untpd.LambdaTypeTree => typedLambdaTypeTree(tree)(localContext(tree, NoSymbol).setNewScope) case tree: untpd.ByNameTypeTree => typedByNameTypeTree(tree) case tree: untpd.TypeBoundsTree => typedTypeBoundsTree(tree) case tree: untpd.Alternative => typedAlternative(tree, pt) -- cgit v1.2.3