summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-02-08 18:28:09 +0000
committerMartin Odersky <odersky@gmail.com>2008-02-08 18:28:09 +0000
commitd3a71dbd88dd98006a893b35d52ad909c8cd10bb (patch)
tree6d5f7ceec3d52caf80789ad8d61f51ae2f006537 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parenta176556bea2482d4c3c86a3604ec1eaa16d0daf1 (diff)
downloadscala-d3a71dbd88dd98006a893b35d52ad909c8cd10bb.tar.gz
scala-d3a71dbd88dd98006a893b35d52ad909c8cd10bb.tar.bz2
scala-d3a71dbd88dd98006a893b35d52ad909c8cd10bb.zip
fixed missing deprecated warning on types; fixe...
fixed missing deprecated warning on types; fixed problem with traits in refinements.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index bc8a15297e..fa37dd5786 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -684,6 +684,15 @@ abstract class RefChecks extends InfoTransform {
result
}
+ /** If symbol is deprecated and is not contained in a depreceated definition,
+ * issue a deprecated warning
+ */
+ def checkDeprecated(sym: Symbol, pos: Position) {
+ if (sym.isDeprecated && !currentOwner.ownerChain.exists(_.isDeprecated)) {
+ unit.deprecationWarning(pos, sym+sym.locationString+" is deprecated")
+ }
+ }
+
/** Check that a deprecated val or def does not override a
* concrete, non-deprecated method. If it does, then
* deprecation is meaningless.
@@ -736,6 +745,7 @@ abstract class RefChecks extends InfoTransform {
new TypeTraverser {
def traverse(tp: Type): TypeTraverser = tp match {
case TypeRef(pre, sym, args) =>
+ checkDeprecated(sym, tree.pos)
if (!tp.isHigherKinded) checkBounds(pre, sym.owner, sym.typeParams, args)
this
case _ =>
@@ -785,9 +795,7 @@ abstract class RefChecks extends InfoTransform {
}
case Select(qual, name) =>
- if (sym.isDeprecated && !currentOwner.ownerChain.exists(_.isDeprecated)) {
- unit.deprecationWarning(tree.pos, sym+sym.locationString+" is deprecated")
- }
+ checkDeprecated(sym, tree.pos)
if (currentClass != sym.owner && (sym hasFlag LOCAL)) {
var o = currentClass
var hidden = false