@@ -1707,7 +1707,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1707
1707
1708
1708
def typed (tree : untpd.Tree , pt : Type = WildcardType )(implicit ctx : Context ): Tree = /* >|>*/ ctx.traceIndented (i " typing $tree" , typr, show = true ) /* <|<*/ {
1709
1709
assertPositioned(tree)
1710
- try adapt(typedUnadapted(tree, pt), pt, tree )
1710
+ try adapt(typedUnadapted(tree, pt), pt)
1711
1711
catch {
1712
1712
case ex : CyclicReference => errorTree(tree, cyclicErrorMsg(ex))
1713
1713
case ex : TypeError => errorTree(tree, ex.getMessage)
@@ -1854,7 +1854,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1854
1854
case Select (qual, name) =>
1855
1855
val qualProto = SelectionProto (name, pt, NoViewsAllowed , privateOK = false )
1856
1856
tryEither { implicit ctx =>
1857
- val qual1 = adaptInterpolated(qual, qualProto, EmptyTree )
1857
+ val qual1 = adaptInterpolated(qual, qualProto)
1858
1858
if ((qual eq qual1) || ctx.reporter.hasErrors) None
1859
1859
else Some (typed(cpy.Select (tree)(untpd.TypedSplice (qual1), name), pt))
1860
1860
} { (_, _) => None
@@ -1863,12 +1863,12 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1863
1863
}
1864
1864
}
1865
1865
1866
- def adapt (tree : Tree , pt : Type , original : untpd. Tree = untpd. EmptyTree )(implicit ctx : Context ): Tree = /* >|>*/ track(" adapt" ) /* <|<*/ {
1866
+ def adapt (tree : Tree , pt : Type )(implicit ctx : Context ): Tree = /* >|>*/ track(" adapt" ) /* <|<*/ {
1867
1867
/* >|>*/ ctx.traceIndented(i " adapting $tree of type ${tree.tpe} to $pt" , typr, show = true ) /* <|<*/ {
1868
1868
if (tree.isDef) interpolateUndetVars(tree, tree.symbol)
1869
1869
else if (! tree.tpe.widen.isInstanceOf [LambdaType ]) interpolateUndetVars(tree, NoSymbol )
1870
1870
tree.overwriteType(tree.tpe.simplified)
1871
- adaptInterpolated(tree, pt, original )
1871
+ adaptInterpolated(tree, pt)
1872
1872
}
1873
1873
}
1874
1874
@@ -1910,7 +1910,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1910
1910
* (14) When in mode EXPRmode, apply a view
1911
1911
* If all this fails, error
1912
1912
*/
1913
- def adaptInterpolated (tree : Tree , pt : Type , original : untpd. Tree )(implicit ctx : Context ): Tree = {
1913
+ def adaptInterpolated (tree : Tree , pt : Type )(implicit ctx : Context ): Tree = {
1914
1914
1915
1915
assert(pt.exists)
1916
1916
@@ -1928,7 +1928,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1928
1928
TermRef .withSigAndDenot(ref.prefix, ref.name, alt.info.signature, alt))
1929
1929
resolveOverloaded(alts, pt) match {
1930
1930
case alt :: Nil =>
1931
- adapt(tree.withType(alt), pt, original )
1931
+ adapt(tree.withType(alt), pt)
1932
1932
case Nil =>
1933
1933
def noMatches =
1934
1934
errorTree(tree,
@@ -1965,7 +1965,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1965
1965
def adaptToArgs (wtp : Type , pt : FunProto ): Tree = wtp match {
1966
1966
case _ : MethodOrPoly =>
1967
1967
if (pt.args.lengthCompare(1 ) > 0 && isUnary(wtp) && ctx.canAutoTuple)
1968
- adaptInterpolated(tree, pt.tupled, original )
1968
+ adaptInterpolated(tree, pt.tupled)
1969
1969
else
1970
1970
tree
1971
1971
case _ => tryInsertApplyOrImplicit(tree, pt) {
@@ -2001,7 +2001,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2001
2001
2002
2002
def adaptNoArgs (wtp : Type ): Tree = wtp match {
2003
2003
case wtp : ExprType =>
2004
- adaptInterpolated(tree.withType(wtp.resultType), pt, original )
2004
+ adaptInterpolated(tree.withType(wtp.resultType), pt)
2005
2005
case wtp : ImplicitMethodType if constrainResult(wtp, followAlias(pt)) =>
2006
2006
val tvarsToInstantiate = tvarsInParams(tree)
2007
2007
wtp.paramInfos.foreach(instantiateSelected(_, tvarsToInstantiate))
@@ -2117,7 +2117,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2117
2117
! (isSyntheticApply(tree) && ! isExpandableApply))
2118
2118
typed(etaExpand(tree, wtp, arity), pt)
2119
2119
else if (wtp.paramInfos.isEmpty && isAutoApplied(tree.symbol))
2120
- adaptInterpolated(tpd.Apply (tree, Nil ), pt, EmptyTree )
2120
+ adaptInterpolated(tpd.Apply (tree, Nil ), pt)
2121
2121
else if (wtp.isImplicit)
2122
2122
err.typeMismatch(tree, pt)
2123
2123
else
@@ -2221,7 +2221,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2221
2221
val prevConstraint = ctx.typerState.constraint
2222
2222
if (pt.isInstanceOf [ProtoType ] && ! failure.isInstanceOf [AmbiguousImplicits ]) tree
2223
2223
else if (isFullyDefined(wtp, force = ForceDegree .all) &&
2224
- ctx.typerState.constraint.ne(prevConstraint)) adapt(tree, pt, original )
2224
+ ctx.typerState.constraint.ne(prevConstraint)) adapt(tree, pt)
2225
2225
else err.typeMismatch(tree, pt, failure)
2226
2226
}
2227
2227
}
@@ -2258,7 +2258,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2258
2258
pt match {
2259
2259
case pt : FunProto
2260
2260
if pt.args.lengthCompare(1 ) > 0 && isUnary(ref) && ctx.canAutoTuple =>
2261
- adaptInterpolated(tree, pt.tupled, original )
2261
+ adaptInterpolated(tree, pt.tupled)
2262
2262
case _ =>
2263
2263
adaptOverloaded(ref)
2264
2264
}
@@ -2271,7 +2271,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2271
2271
}
2272
2272
if (typeArgs.isEmpty) typeArgs = constrained(poly, tree)._2
2273
2273
convertNewGenericArray(
2274
- adaptInterpolated(tree.appliedToTypeTrees(typeArgs), pt, original ))
2274
+ adaptInterpolated(tree.appliedToTypeTrees(typeArgs), pt))
2275
2275
}
2276
2276
case wtp =>
2277
2277
if (isStructuralTermSelect(tree)) adapt(handleStructural(tree), pt)
0 commit comments