First off, this doesn't actually have anything to do with implicits -- it just happens to be a problem with spark and raster Implicits class and how it references all the other classes it extends.
The core of this is that prior to 2.13, the resolution between local identifiers (in this case, a relative reference to a class) and imported identifiers did not conform to the spec. The references to several classes resolved to the local package rather than an imported package. This was fixed in 2.13, so these two files no longer compile because the class identifiers resolve differently now.
For example, interpolation.Implicits resolved to the local geotrellis.raster.interpolation.Implicits rather than what it should have resolved to according to the spec, which is that the existence of import geotrellis.vector._ results in it being geotrellis.vector.interpolation.Implicits -- this is a problem, because the package geotrellis.vector.interpolation exists, but not geotrellis.vector.interpolation.Implicits, so compilation fails.
I thought through a few solutions to this, including explicitly importing only what's actually needed from other packages instead of _, but just changing this to the fqn of the Implicits classes seems the most obvious option.
Also, fixed a couple of instances of unnecessary new with case classes.
Checklist
[ ] n/a ./CHANGELOG.md updated, if necessary. Link to the issue if closed, otherwise the PR.
Overview
First off, this doesn't actually have anything to do with implicits -- it just happens to be a problem with spark and raster Implicits class and how it references all the other classes it extends.
The core of this is that prior to 2.13, the resolution between local identifiers (in this case, a relative reference to a class) and imported identifiers did not conform to the spec. The references to several classes resolved to the local package rather than an imported package. This was fixed in 2.13, so these two files no longer compile because the class identifiers resolve differently now.
For example,
interpolation.Implicits
resolved to the localgeotrellis.raster.interpolation.Implicits
rather than what it should have resolved to according to the spec, which is that the existence ofimport geotrellis.vector._
results in it beinggeotrellis.vector.interpolation.Implicits
-- this is a problem, because the packagegeotrellis.vector.interpolation
exists, but notgeotrellis.vector.interpolation.Implicits
, so compilation fails.I thought through a few solutions to this, including explicitly importing only what's actually needed from other packages instead of
_
, but just changing this to the fqn of the Implicits classes seems the most obvious option.Also, fixed a couple of instances of unnecessary
new
with case classes.Checklist
docs
guides update, if necessaryDemo
none
Notes
Discussion: https://github.com/scala/bug/issues/11593
Bug(s):
https://github.com/scala/bug/issues/9552 https://github.com/scala/bug/issues/2458
Fix for Bug: https://github.com/scala/scala/pull/6589