Aladdin - Scala Bugtracking
[#122] project: compiler priority: low category: bug
submitter assigned to status date submitted
Erik Martin fixed 2003-09-10 16:23:36.0
subject Bad error message for recursive patterns
code
class L{
  val List(v:int,2) = List(2,v:int); 
  val Pair(a:int,b:int) = Pair(1,a);
}
what happened
~/scala/bin/scalac L.scala 
L.scala:2: recursive value v$ needs type
  val List(v:int,2) = List(2,v:int); 
      ^
L.scala:3: recursive value ds$0$ needs type
  val Pair(a:int,b:int) = Pair(1,a);
      ^
two errors found
what expected A slightly more understandable error message without references to internal variables. (I especially like the ds$0$ ;)
[back to overview]
Changes of this bug report
Burak  edited on  2003-09-23 18:26:56.0
change priority
Lex  edited on  2006-03-28 13:49:00.0
The current error message is better:
bug122.scala:2 error: recursive value v needs type
  val List(v:int,2) = List(2,v:int);
                             ^
bug122.scala:3 error: recursive value a needs type
  val Pair(a:int,b:int) = Pair(1,a);
                                 ^
two errors found
It would be nicer to report this as a circular val definition....
Martin  edited on  2006-05-28 14:46:16.0
We now get:
bug122.scala:2 error: recursive value v needs type
  val List(v:int,2) = List(2,v:int); 
                             ^
bug122.scala:3 error: recursive value a needs type
  val Pair(a:int,b:int) = Pair(1,a);
                                 ^
two errors found
Martin  edited on  2006-05-31 11:39:33.0
We now accept this example.