summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index f8dd35cfdd..34f832f2a6 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -372,7 +372,12 @@ trait NamesDefaults { self: Analyzer =>
// var x = 0
// f(x = 1) << "x = 1" typechecks with expected type WildcardType
val udp = typer.context.extractUndetparams()
- val subst = new SubstTypeMap(udp, udp map (_ => WildcardType))
+ val subst = new SubstTypeMap(udp, udp map (_ => WildcardType)) {
+ override def apply(tp: Type): Type = tp match {
+ case TypeRef(_, sym, List(arg)) if (sym == ByNameParamClass) => super.apply(arg)
+ case _ => super.apply(tp)
+ }
+ }
val res = typer.silent(_.typed(arg, subst(paramtpe))) match {
case _: TypeError =>
positionalAllowed = false