summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-09-09 09:45:38 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-09-09 09:45:38 +0000
commitf7751134d1c090d16e8121cc5fade6b9a1a17550 (patch)
tree214099e834e95934f363cd4d3c1ab69603c87d7e /src
parent56d5033a4dfe4c1c9173c7446104cd3a55ea3926 (diff)
downloadscala-f7751134d1c090d16e8121cc5fade6b9a1a17550.tar.gz
scala-f7751134d1c090d16e8121cc5fade6b9a1a17550.tar.bz2
scala-f7751134d1c090d16e8121cc5fade6b9a1a17550.zip
fix fix for (close #3791) and made deprecation ...
fix fix for (close #3791) and made deprecation for constants work. no review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Definitions.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
index a7fbcd7019..16563bb38c 100644
--- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
@@ -738,7 +738,7 @@ trait Definitions extends reflect.generic.StandardDefinitions {
addModuleMethod(FloatClass, "MinNegativeValue", -java.lang.Float.MAX_VALUE)
addModuleMethod(FloatClass, "MaxValue", java.lang.Float.MAX_VALUE)
addDeprecatedModuleMethod(FloatClass, "Epsilon", java.lang.Float.MIN_VALUE, "use Float.MinPositiveValue instead")
- addModuleMethod(FloatClass, "MinPositiveValue", -java.lang.Float.MAX_VALUE)
+ addModuleMethod(FloatClass, "MinPositiveValue", java.lang.Float.MIN_VALUE)
addModuleMethod(FloatClass, "NaN", java.lang.Float.NaN)
addModuleMethod(FloatClass, "PositiveInfinity", java.lang.Float.POSITIVE_INFINITY)
addModuleMethod(FloatClass, "NegativeInfinity", java.lang.Float.NEGATIVE_INFINITY)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c86fc05c47..8248c5c950 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -780,6 +780,11 @@ trait Typers { self: Analyzer =>
case atp @ AnnotatedType(_, _, _) if canAdaptAnnotations(tree, mode, pt) => // (-1)
adaptAnnotations(tree, mode, pt)
case ct @ ConstantType(value) if ((mode & (TYPEmode | FUNmode)) == 0 && (ct <:< pt) && !onlyPresentation) => // (0)
+ val sym = tree.symbol
+ if (sym != null && sym.isDeprecated) {
+ val msg = sym.toString + sym.locationString +" is deprecated: "+ sym.deprecationMessage.getOrElse("")
+ unit.deprecationWarning(tree.pos, msg)
+ }
treeCopy.Literal(tree, value)
case OverloadedType(pre, alts) if ((mode & FUNmode) == 0) => // (1)
inferExprAlternative(tree, pt)