Modifies "maybeRewrap" to focus more on the maybe.#1900
Modifies "maybeRewrap" to focus more on the maybe.#1900paulp merged 1 commit intoscala:masterfrom paulp:pr/maybe-rewrap-less
Conversation
Existential types are rewrapped under a bunch of conditions unless the operation performed on the underlying type returns the same type by reference equality. That depends on a foundation of predictability which doesn't exist. The upshot is that existential types were rewrapped with abandon, even when the type were identical. This had both performance and correctness implications. Note where the test case output changes like so: -scala.collection.immutable.List[Any] +scala.collection.immutable.List[<?>] That's correctness.
|
Review by @adriaanm |
|
Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1395/ |
|
jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1395/ |
|
Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2115/ |
|
jenkins job pr-scala-testsuite-linux-opt: Failed - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2115/ |
|
PLS REBUILD ALL |
|
Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1403/ |
|
Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1408/ |
|
jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/1408/ |
|
Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2131/ |
|
jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/2131/ |
|
BUMP @adriaanm |
|
LGTM sorry about the slippage-from-radar |
Modifies "maybeRewrap" to focus more on the maybe.
We'll just have to live with manifests not being able to resolve the difference between `scala.List[_]` and `scala.List[Any]` (dealiasing causes rewrapping causes existential extrapolation). They are equivalent types after all (and manifests are deprecated). A type tag will be more precise. This commit reverts scala#1900, which caused this regression. Recently, scala#5263 improved the situation a bit, but showed that the original tweak was not a good idea (too many exceptions). Also, I doubt using `=:=` will improve performance, even if it reduces allocation a bit, as it's far more expensive than `eq`...
Existential types are rewrapped under a bunch of conditions
unless the operation performed on the underlying type returns
the same type by reference equality. That depends on a
foundation of predictability which doesn't exist. The upshot is
that existential types were rewrapped with abandon, even when
the type were identical.
This had both performance and correctness implications.
Note where the test case output changes like so:
-scala.collection.immutable.List[Any]
+scala.collection.immutable.List[<?>]
That's correctness.