Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sneaky binary incompatibility in Discover.scala (com-lihaoyi#2752)
fixes com-lihaoyi#2749 The basic problem is that the signature of `Discover.apply()` changed, but it only changed in the argument's generic type parameters, so it was nominally the same type after erasure, and accepted the `Map[Class[_], Seq]` even though it was expecting a `Map[Class[_], (Seq, Seq)]`, but later on in the code it would blow up with a `ClassCastException` This causes problems with Mill plugins containing external modules, which have their own `Discover[T]` macro pre-expanded and would not get re-compiled with the new 0.11.3 version of Mill. This PR works around the problem by adding a forwarder `Discover.apply(value: Map[Class, Seq])` that does the right thing and expands the `Seq` into a `(Seq, Seq)`, while adding a dummy paramter to `case class Discover` to avoid conflicts. A similar forwarder `Discover.<init>(value: Map[Class, Seq])` is needed to preserve binary compatibility (I think?) Tested manually via `./mill -i dev.run example/basic/1-simple-scala --import ivy:io.chris-kipp::mill-github-dependency-graph::0.2.6 io.kipp.mill.github.dependency.graph.Graph/generate`, which fails before this PR and passes after --------- Co-authored-by: Chris Kipp <ckipp@pm.me> Co-authored-by: Tobias Roeser <le.petit.fou@web.de>
- Loading branch information