Github user JoshRosen commented on the issue:
https://github.com/apache/spark/pull/15571
Yep, this new MiMa inspection was added in
https://github.com/typesafehub/migration-manager/issues/119:
> When a new abstract class/trait with abstract members is added to the
hierarchy of an existing class/trait, a binary incompatibility must be reported
if the abstract members added by the new type did not exist in the hierarchy of
the existing class/trait.
Looking at our particular error, it appears that this was introduced by
https://github.com/apache/spark/commit/61ef74f2272faa7ce8f2badc7e00039908e3551f,
which added a new `HasAggregationDepth` trait and then mixed it into other
traits.
It looks like `HasAggregationDepth` actually defines `final`
implementations for al of its methods:
```scala
/**
* Trait for shared param aggregationDepth (default: 2).
*/
private[ml] trait HasAggregationDepth extends Params {
/**
* Param for suggested depth for treeAggregate (>= 2).
* @group param
*/
final val aggregationDepth: IntParam = new IntParam(this,
"aggregationDepth", "suggested depth for treeAggregate (>= 2)",
ParamValidators.gtEq(2))
setDefault(aggregationDepth, 2)
/** @group getParam */
final def getAggregationDepth: Int = $(aggregationDepth)
}
```
I think that a trait with fields / implementations compiles down to both an
interface and an abstract class in Scala 2.10 / 2.11, so I imagine that this
isn't actually okay. This is confirmed by one of the test cases in MiMa:
https://github.com/dotta/migration-manager/tree/54d54a8d1d7f0da8909c860e734bc1335ddae4c4/reporter/functional-tests/src/test/trait-extending-new-trait-with-concrete-method-nok
@dotta, to clarify the wording in your commit to MiMa, is it accurate to
replace "abstract members" by just "members" and say that adding any members to
a trait, abstract or concrete, can introduce a binary incompatibility if it
wasn't already presence in subclasses's existing hierarchy?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]