- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Compiler (2.8.1) bug?
Sun, 2011-03-27, 16:19
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
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