Aladdin - Scala Bugtracking
[#1010] project: compiler priority: high category: bug
submitter assigned to status date submitted
Burak Martin fixed 2007-03-22 16:22:00.0
subject adrian's bug: selecting class on unstable term doesn't work
code
class MailBox {
 class Message
 //type Message = AnyRef
}

abstract class Actor {
 private val in = new MailBox

 def send(msg: in.Message) =  error("foo")

 def unstable: Actor = error("foo")

 def dubiousSend(msg: MailBox#Message) =
   unstable.send(msg) // in.Message becomes unstable.Message, but that's ok since Message is a concrete type member
}
what happened
/Users/adriaan/Documents/workspace/scala/test/files/pos/typealias_dubious.scala:14:
error: method send cannot be accessed in Actor
 because its instance type (Actor#in.Message)scala.Nothing contains a
malformed type: Actor#in
   unstable.send(msg) // in.Message becomes unstable.Message, but
that's ok since Message is a concrete type member
           ^
one error found
what expected no error
[back to overview]
Changes of this bug report
Martin  edited on  2007-03-23 12:49:56.0