When I compile this code, I get ambiguous reference error for method m1. Can someone tell me why?
object MyClass { trait T { def m1(str: String): Unit = println(str) def m1: Unit = { println("m1") m1("from:m1") } } class C extends T { override def m1(str: String): Unit = println(str+"1") } def main(args: Array[String]): Unit = { val c = new C() c.m1 } } 
def m1(): Unit = {and thus the call site must bec.m1()and that should fix the ambiguity problem.