Aladdin - Scala Bugtracking
[#932] project: compiler priority: low category: bug
submitter assigned to status date submitted
Burak Martin fixed 2007-02-03 12:20:43.0
subject sealed does not survive sep. comp.
code
// file foo.scala
package broken 

sealed class foo

case class bar() extends foo
case object baz extends foo

// file use.scala
import broken._
object use {
  (null:foo) match {
    case bar() => 
  }
}
what happened
exhaustivity is only checked when compiled together, when compiling separately the warning is not generated.
Burak-Emirs-MacBook-Pro:~/Documents/svn/scala buraq$ ./build/locker/bin/scalac -classpath /tmp -d /tmp /tmp/use.\
scala /tmp/foo.scala 
/tmp/use.scala:3: warning: does not cover case {object baz}
  (null:foo) match {
       ^
one warning found
Burak-Emirs-MacBook-Pro:~/Documents/svn/scala buraq$ ./build/locker/bin/scalac -d /tmp /tmp/foo.scala 
Burak-Emirs-MacBook-Pro:~/Documents/svn/scala buraq$ ./build/locker/bin/scalac -classpath /tmp -d /tmp /tmp/use.\
scala 
what expected the sealed attribute to be set also for already compiled classes, alternatively the children method to work correctly. (one of them is wrong, because obviously the pattern matching translation is unaware of were classes come from).
[back to overview]
Changes of this bug report
Burak  edited on  2007-02-03 12:20:54.0
Burak  edited on  2007-02-03 12:21:16.0
formatting
Burak  edited on  2007-02-03 12:21:59.0
Martin  edited on  2007-02-03 19:33:34.0