diff options
author | Som Snytt <som.snytt@gmail.com> | 2017-02-24 13:53:47 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2017-02-26 18:24:00 -0800 |
commit | 094f7f9463b46ff4f14d6e00b5ab81ed73fa8eb0 (patch) | |
tree | 5c109d19ed87ff124d9de387a7ae9992dbbb739d /src | |
parent | 5f1a638cf5f3b81fd3d8b4fa92a5a52ac5733517 (diff) | |
download | scala-094f7f9463b46ff4f14d6e00b5ab81ed73fa8eb0.tar.gz scala-094f7f9463b46ff4f14d6e00b5ab81ed73fa8eb0.tar.bz2 scala-094f7f9463b46ff4f14d6e00b5ab81ed73fa8eb0.zip |
SI-10207 Error before update conversion
Gaze deeper for errors before committing to conversion
of assignment to update. The error buried in the transformed
tree escapes notice of retypechecking and leaks to backend.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 65d1910364..8333d5d295 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4666,19 +4666,20 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper val qual1 = typedQualifier(qual) if (treeInfo.isVariableOrGetter(qual1)) { if (Statistics.canEnable) Statistics.stopTimer(failedOpEqNanos, opeqStart) - val erred = qual1.isErroneous || args.exists(_.isErroneous) + val erred = qual1.exists(_.isErroneous) || args.exists(_.isErroneous) if (erred) reportError(error) else { val convo = convertToAssignment(fun, qual1, name, args) silent(op = _.typed1(convo, mode, pt)) match { case SilentResultValue(t) => t - case err: SilentTypeError => reportError(SilentTypeError(advice1(convo, error.errors, err), error.warnings)) + case err: SilentTypeError => reportError( + SilentTypeError(advice1(convo, error.errors, err), error.warnings) + ) } } - } - else { + } else { if (Statistics.canEnable) Statistics.stopTimer(failedApplyNanos, appStart) val Apply(Select(qual2, _), args2) = tree - val erred = qual2.isErroneous || args2.exists(_.isErroneous) + val erred = qual2.exists(_.isErroneous) || args2.exists(_.isErroneous) reportError { if (erred) error else SilentTypeError(advice2(error.errors), error.warnings) } |