Guest User

Untitled

a guest
May 26th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. package sample
  2.  
  3. trait T {
  4. def names(names:List[String], man:Boolean=true):Unit = {} // これを消すと正常動作
  5. def names(name:String, man:Boolean=true):Unit = {}
  6. }
  7.  
  8. object O extends T {
  9. def call = {
  10. names("name") // Error
  11. }
  12. }
  13.  
  14. /* Error:
  15. ambiguous reference to overloaded definition, both method names$default$2 in trait T of type => Boolean and method names$default$2 in trait T of type => Boolean match expected type Boolean
  16. */
Add Comment
Please, Sign In to add comment