Guest User

Untitled

a guest
Jun 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. object foo {
  2. class A
  3. object A {
  4. implicit def blah(a: A) = 0
  5. }
  6.  
  7. class B {
  8. def foo(implicit foo: List[B]) = null
  9. }
  10.  
  11. object B {
  12. implicit val blah = List(new B) // type B must be a part of type of blah
  13. }
  14.  
  15. def main(args: Array[String]) {
  16. val i: Int = new A()
  17. val b = new B
  18. b.foo
  19.  
  20. }
  21.  
  22. }
Add Comment
Please, Sign In to add comment