summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-01-10 11:52:22 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-01-10 11:52:22 +0000
commit9026bd6e029b8655239071ab9b6da94ad97113bf (patch)
tree67a9a97e13369d2d721699071bbdcf5c67d67d7a /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentb05c8ebc8f7cf3240a2f9e18f1255b5bb64f2ab4 (diff)
downloadscala-9026bd6e029b8655239071ab9b6da94ad97113bf.tar.gz
scala-9026bd6e029b8655239071ab9b6da94ad97113bf.tar.bz2
scala-9026bd6e029b8655239071ab9b6da94ad97113bf.zip
Re-disabled constant folding for interactive co...
Re-disabled constant folding for interactive compiler runs. no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 784531ba1e..28faf16541 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -656,7 +656,7 @@ trait Typers extends Modes {
/** Perform the following adaptations of expression, pattern or type `tree' wrt to
* given mode `mode' and given prototype `pt':
* (-1) For expressions with annotated types, let AnnotationCheckers decide what to do
- * (0) Convert expressions with constant types to literals
+ * (0) Convert expressions with constant types to literals (unless in interactive/scaladoc mode)
* (1) Resolve overloading, unless mode contains FUNmode
* (2) Apply parameterless functions
* (3) Apply polymorphic types to fresh instances of their type parameters and
@@ -692,7 +692,7 @@ trait Typers extends Modes {
protected def adapt(tree: Tree, mode: Int, pt: Type, original: Tree = EmptyTree): Tree = tree.tpe match {
case atp @ AnnotatedType(_, _, _) if canAdaptAnnotations(tree, mode, pt) => // (-1)
adaptAnnotations(tree, mode, pt)
- case ct @ ConstantType(value) if inNoModes(mode, TYPEmode | FUNmode) && (ct <:< pt) && !forScaladoc => // (0)
+ case ct @ ConstantType(value) if inNoModes(mode, TYPEmode | FUNmode) && (ct <:< pt) && !forScaladoc && !forInteractive => // (0)
val sym = tree.symbol
if (sym != null && sym.isDeprecated) {
val msg = sym.toString + sym.locationString +" is deprecated: "+ sym.deprecationMessage.getOrElse("")