diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2010-09-09 09:45:38 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2010-09-09 09:45:38 +0000 |
commit | f7751134d1c090d16e8121cc5fade6b9a1a17550 (patch) | |
tree | 214099e834e95934f363cd4d3c1ab69603c87d7e /src/compiler | |
parent | 56d5033a4dfe4c1c9173c7446104cd3a55ea3926 (diff) | |
download | scala-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/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
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) |