summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-06-06 13:18:09 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-06-08 15:23:06 +0200
commitf0683d82d23cccf372b76528520422a2ac5a266a (patch)
treebd9a57a5e6368a78b29b1e6a0ba59efcf8ab3d89
parent1fac5bcbbcb9bbfc5953c29574f3952b97945921 (diff)
downloadscala-f0683d82d23cccf372b76528520422a2ac5a266a.tar.gz
scala-f0683d82d23cccf372b76528520422a2ac5a266a.tar.bz2
scala-f0683d82d23cccf372b76528520422a2ac5a266a.zip
typers: fixes error handling in checkStable
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index b0f6e44e88..86eb4b678f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -237,7 +237,9 @@ trait Typers extends Modes with Adaptations with Taggings {
* @return ...
*/
def checkStable(tree: Tree): Tree =
- if (treeInfo.isExprSafeToInline(tree)) tree else UnstableTreeError(tree)
+ if (treeInfo.isExprSafeToInline(tree)) tree
+ else if (tree.isErrorTyped) tree
+ else UnstableTreeError(tree)
/** Would tree be a stable (i.e. a pure expression) if the type
* of its symbol was not volatile?