diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-03-17 22:01:30 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-03-17 22:01:30 -0700 |
commit | 752aa52207bf0e29baeccf2ac369e80f257821b1 (patch) | |
tree | e076cdb998e1adc7caa3865c329e396c920dc77b /src | |
parent | 44af7449d137467079a610f6a702dc10a1fc9472 (diff) | |
parent | 174334b9095be2be79c164bbdea1749dab9e0cbe (diff) | |
download | scala-752aa52207bf0e29baeccf2ac369e80f257821b1.tar.gz scala-752aa52207bf0e29baeccf2ac369e80f257821b1.tar.bz2 scala-752aa52207bf0e29baeccf2ac369e80f257821b1.zip |
Merge pull request #2253 from retronym/ticket/7239
SI-6921 SI-7239 Tread lightly during exploratory typing
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index 1c60f0a79d..f3736f1519 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -502,7 +502,7 @@ trait NamesDefaults { self: Analyzer => // disable conforms as a view... val errsBefore = reporter.ERROR.count try typer.silent { tpr => - val res = tpr.typed(arg, subst(paramtpe)) + val res = tpr.typed(arg.duplicate, subst(paramtpe)) // better warning for SI-5044: if `silent` was not actually silent give a hint to the user // [H]: the reason why `silent` is not silent is because the cyclic reference exception is // thrown in a context completely different from `context` here. The exception happens while diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 93d24996eb..ef28837c51 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1375,9 +1375,8 @@ trait Typers extends Modes with Adaptations with Tags { def onError(reportError: => Tree): Tree = { context.tree match { case Apply(tree1, args) if (tree1 eq tree) && args.nonEmpty => - silent(_.typedArgs(args, mode)) match { - case SilentResultValue(xs) => - val args = xs.asInstanceOf[List[Tree]] + silent(_.typedArgs(args.map(_.duplicate), mode)) match { + case SilentResultValue(args) => if (args exists (_.isErrorTyped)) reportError else |