summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-06-25 14:30:41 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-06-25 14:30:41 +0000
commitff1eb3aa120b0cc01bae7c6b6d898e3e90dad9d1 (patch)
tree4451a0d97980d40f1545cb9286b1c787c0a2f537 /src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
parentac7180cf635ac0e10064bf2f73f5012017601b9c (diff)
downloadscala-ff1eb3aa120b0cc01bae7c6b6d898e3e90dad9d1.tar.gz
scala-ff1eb3aa120b0cc01bae7c6b6d898e3e90dad9d1.tar.bz2
scala-ff1eb3aa120b0cc01bae7c6b6d898e3e90dad9d1.zip
small fix to named arguments
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala')
-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