This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Compiler (2.8.1) bug?

No replies
Alexander Azarov
Joined: 2011-03-27,
User offline. Last seen 42 years 45 weeks ago.
Hello,

Please see the transcript below. What's going on there? Seems to be a bug..

$ scala
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala> trait A
defined trait A

scala> class B(implicit a: String) { self: A =>
     | println(a)
     | }
<console>:7: error: not found: value a
       println(a)
               ^

scala> class B(implicit a: String) {
     | println(a)
     | }
defined class B

scala> class B(val a: String) {
     | println(a)
     | }
defined class B

Apparently this works as expected in 2.9.0.RC1

Regards,
Alexander

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland