Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Welcome to Scala version 2.9.0.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
- Type in expressions to have them evaluated.
- Type :help for more information.
- scala> trait scope {
- | class A extends AnyRef with Z {
- | def aaa() = zzz2()
- | def aaa2() = 100
- | }
- | trait Z {self: A =>
- | def zzz() = aaa2()
- | def zzz2() = 22
- | }
- | }
- defined trait scope
- scala> object M extends scope {
- | def main(args: Array[String]) {
- | val a = new A
- | println(a.aaa() + a.zzz())
- | }
- | }
- defined module M
- scala> M.main(Array())
- 122
Add Comment
Please, Sign In to add comment