From 18da7faf93ffaefa0ee7e37211c740c1f34ddfa2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 15 Nov 2013 12:25:13 +0100 Subject: Tweaks to adaptation and interpolation 1. Needed to interpolate aftyer implicit parameyters are added. 2. Also needed to avoid constraining typevars if compared against selection proto. Original coder example now typechecks. --- src/dotty/tools/dotc/typer/Applications.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Applications.scala') diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala index 201f928a9..ba67d2b1e 100644 --- a/src/dotty/tools/dotc/typer/Applications.scala +++ b/src/dotty/tools/dotc/typer/Applications.scala @@ -356,7 +356,7 @@ trait Applications extends Compatibility { self: Typer => init() def addArg(arg: Tree, formal: Type): Unit = - typedArgBuf += adapt(arg, formal) + typedArgBuf += adaptInterpolated(arg, formal) def makeVarArg(n: Int, elemFormal: Type): Unit = { val args = typedArgBuf.takeRight(n).toList @@ -467,7 +467,7 @@ trait Applications extends Compatibility { self: Typer => } { failed => fun1 match { case Select(qual, name) => tryEither { implicit ctx => - val qual1 = adapt(qual, new SelectionProto(name, proto)) + val qual1 = adaptInterpolated(qual, new SelectionProto(name, proto)) if (qual1.tpe.isError || (qual1 eq qual)) qual1 else typedApply( -- cgit v1.2.3