Aladdin - Scala Bugtracking
[#253] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Michel Martin fixed 2003-12-09 14:39:09.0
subject Constant folder too aggressive
code
object Main {
  def const = { System.out.println("hello, world"); 5 };
  def main(args: Array[String]): Unit = { const; }
}
what happened
The program compiles but prints nothing. The problem is that the constant folder is way too aggressive, and cons\
iders that function const is equivalent to "5", and simply replaces the call by the constant 5!
what expected a friendly "hello" message
[back to overview]
Changes of this bug report
Michel  edited on  2003-12-09 14:39:23.0
Martin  edited on  2004-01-06 13:54:49.0