summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-10-15 14:22:32 +0000
committerMartin Odersky <odersky@gmail.com>2008-10-15 14:22:32 +0000
commit8b63b6aacbb2efbabe91fe8e9bebcbbcfc242b8e (patch)
treeb657c27ac86edce27d8a8335397ce00de9d969a7 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent7e3aecae9e738c9f4129e1c9b841837722b38dd6 (diff)
downloadscala-8b63b6aacbb2efbabe91fe8e9bebcbbcfc242b8e.tar.gz
scala-8b63b6aacbb2efbabe91fe8e9bebcbbcfc242b8e.tar.bz2
scala-8b63b6aacbb2efbabe91fe8e9bebcbbcfc242b8e.zip
Tightened volatile checking.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 798a0f91af..9c82ffad1f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2140,7 +2140,11 @@ trait Typers { self: Analyzer =>
def apply(tp: Type): Type = tp match {
case TypeRef(pre, sym, args) =>
if (sym.isAliasType && containsLocal(tp)) apply(tp.normalize)
- else mapOver(tp)
+ else {
+ if (pre.isVolatile)
+ context.error(tree.pos, "Inferred type "+tree.tpe+" contains type selection from volatile type "+pre)
+ mapOver(tp)
+ }
case _ =>
mapOver(tp)
}