Advertisement
Guest User

Untitled

a guest
Mar 18th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.87 KB | None | 0 0
  1.   class toto(s: String) {                                                            
  2.   }                                                                                  
  3.                                                                                      
  4.   object tata {                                                                      
  5.     def t(implicit a: toto) {                                                        
  6.       println("Got in tata; " + a)                                                  
  7.                                                                                      
  8.     }                                                                                
  9.   }                                                                                  
  10.                                                                                      
  11.   object essai {                                                                    
  12.     def t(implicit a: toto) {                                                        
  13.       tata.t                                                                        
  14.       println("Got "+a)                                                              
  15.     }                                                                                
  16.   }                                                                                  
  17.                                                                                      
  18. >>{                                                                                                                                                                                                                                                                  
  19.     implicit val t: toto = new toto("Hello")                                      
  20.     essai.t                                                                          
  21.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement