Is adding a trait method with implementation breaking backward compatibility?
问题 I am confused regarding backward compatibility when adding a method with default implementation to a trait. Like: Previous Version trait Foo New Version trait Foo { def verifyConsistency: Option[String] = ??? // provide default implementation } The Migration Manager reports this addition as a binary incompatibility. Is that correct? 回答1: Well yes it is correct. When you define trait Foo , it will under the hood create both a (JVM) interface Foo and a (JVM) class Foo$class with all the method