Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object X
- object Y extends X
- trait T{
- // some behavior goes here
- }
- object X extends T
- object Y extends T {
- // additional stuff here
- }
- object X{
- def x = 5
- }
- object Y{
- import X._
- val y = x
- }
- object X {
- }
- object Y {
- def a = 5
- }
- implicit def xToY(x: X.type) = Y
- println(X.a)
- class Parent {}
- object Parent extends Parent {}
- object Child extends Parent {}
- object X { def f = 5 }
- object Y {
- export X._
- def g = 42
- def h = f * g
- }
- Y.f // 5
- Y.g // 42
- Y.h // 210
- object X { def f = 5; def g = 6 }
- object Y { export X.f }
- Y.f // 5
- Y.g
- ^^^
- value g is not a member of Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement