Skip to content

Commit 954e080

Browse files
Address review
1 parent 30097fe commit 954e080

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
955955
}
956956
val dummyArg = dummyTreeOfType(ownType)
957957
val unapplyApp = typedExpr(untpd.TypedSplice(Apply(unapplyFn, dummyArg :: Nil)))
958-
def unapplyImplicits(unapp: Tree = unapplyApp): List[Tree] = unapp match {
958+
def unapplyImplicits(unapp: Tree): List[Tree] = unapp match {
959959
case Apply(Apply(unapply, `dummyArg` :: Nil), args2) => assert(args2.nonEmpty); args2
960960
case Apply(unapply, `dummyArg` :: Nil) => Nil
961961
case Inlined(u, _, _) => unapplyImplicits(u)
@@ -982,7 +982,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
982982
List.fill(argTypes.length - args.length)(WildcardType)
983983
}
984984
val unapplyPatterns = (bunchedArgs, argTypes).zipped map (typed(_, _))
985-
val result = assignType(cpy.UnApply(tree)(unapplyFn, unapplyImplicits(), unapplyPatterns), ownType)
985+
val result = assignType(cpy.UnApply(tree)(unapplyFn, unapplyImplicits(unapplyApp), unapplyPatterns), ownType)
986986
unapp.println(s"unapply patterns = $unapplyPatterns")
987987
if ((ownType eq selType) || ownType.isError) result
988988
else tryWithClassTag(Typed(result, TypeTree(ownType)), selType)

compiler/src/dotty/tools/dotc/typer/ReTyper.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class ReTyper extends Typer {
5454

5555
override def typedTyped(tree: untpd.Typed, pt: Type)(implicit ctx: Context): Tree = {
5656
assertTyped(tree)
57-
val type1 = checkSimpleKinded(typedType(tree.tpt))
58-
val tree1 = tree.expr match {
57+
val tpt1 = checkSimpleKinded(typedType(tree.tpt))
58+
val expr1 = tree.expr match {
5959
case id: untpd.Ident if (ctx.mode is Mode.Pattern) && untpd.isVarPattern(id) && (id.name == nme.WILDCARD || id.name == nme.WILDCARD_STAR) =>
60-
tree.expr.withType(type1.tpe)
60+
tree.expr.withType(tpt1.tpe)
6161
case _ => typed(tree.expr)
6262
}
63-
untpd.cpy.Typed(tree)(tree1, type1).withType(tree.typeOpt)
63+
untpd.cpy.Typed(tree)(expr1, tpt1).withType(tree.typeOpt)
6464
}
6565

6666
override def typedTypeTree(tree: untpd.TypeTree, pt: Type)(implicit ctx: Context): TypeTree =

0 commit comments

Comments
 (0)