summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-04-01 08:39:11 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-04-01 08:39:11 +0000
commit7b43c30aa1746cb37ee65f2871e4e92e82896a10 (patch)
treebd12553e5f7d84e8910c678b401afb68c1cef98e /src
parentf32f87226959f9def3e3e14725898bd3c39840f8 (diff)
downloadscala-7b43c30aa1746cb37ee65f2871e4e92e82896a10.tar.gz
scala-7b43c30aa1746cb37ee65f2871e4e92e82896a10.tar.bz2
scala-7b43c30aa1746cb37ee65f2871e4e92e82896a10.zip
close #3178. review by community
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index 3978ea263b..6288c06a67 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -440,6 +440,8 @@ trait NamesDefaults { self: Analyzer =>
case _ => super.apply(tp)
}
}
+ val reportAmbiguousErrors = typer.context.reportAmbiguousErrors
+ typer.context.reportAmbiguousErrors = false
val res = typer.silent(_.typed(arg, subst(paramtpe))) match {
case _: TypeError =>
// if the named argument is on the original parameter
@@ -457,6 +459,7 @@ trait NamesDefaults { self: Analyzer =>
errorTree(arg, "reference to "+ name +" is ambiguous; it is both, a parameter\n"+
"name of the method and the name of a variable currently in scope.")
}
+ typer.context.reportAmbiguousErrors = reportAmbiguousErrors
//@M note that we don't get here when an ambiguity was detected (during the computation of res),
// as errorTree throws an exception
typer.context.undetparams = udp