summaryrefslogtreecommitdiff
path: root/test/files/pos/existental-slow-compile2.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-10-29 13:01:07 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-11-13 14:24:35 +1000
commit238b1fba3d5085457d05817c646d436542def5ea (patch)
tree3a828a30eaa286ba8c28fc918f9dc15cd6602232 /test/files/pos/existental-slow-compile2.scala
parenta24ca7fa617cabada82c43d2d6ac354db698d181 (diff)
downloadscala-238b1fba3d5085457d05817c646d436542def5ea.tar.gz
scala-238b1fba3d5085457d05817c646d436542def5ea.tar.bz2
scala-238b1fba3d5085457d05817c646d436542def5ea.zip
Attacking exponential complexity in TypeMaps
- Don't normalize existentials during the `contain`-s type map; `ExistentialType#normalize' calls contains internally and an exponential blowup ensues. - Ensure that the type map used in variance validation never returns modified types in order to avoid needless cloning of symbols. The enclosed test case still gets stuck in Uncurry, thanks to the way that `TypeMap#mapOver(List[Symbol])` recurses through the type first to check whether the type map would be an no-op or not. If not, it repeats the type map with cloned symbols. Doing the work twice at each level of recursion blows up the complexity. Removing that "fast path" allows the enclosed test to compile completely. As at this commit, it gets stuck in uncurry, which dealiases `s.List` to `s.c.i.List` within the type. Some more background on the troublesome part of `TypeMap`: http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=1210.html https://github.com/scala/scala/commit/f8b2b21050e7a2ca0f537ef70e3e0c8eead43abc
Diffstat (limited to 'test/files/pos/existental-slow-compile2.scala')
-rw-r--r--test/files/pos/existental-slow-compile2.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/pos/existental-slow-compile2.scala b/test/files/pos/existental-slow-compile2.scala
new file mode 100644
index 0000000000..907344982c
--- /dev/null
+++ b/test/files/pos/existental-slow-compile2.scala
@@ -0,0 +1,7 @@
+class C {
+ class L[+A]
+ def test = {
+ val foo:
+ L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: _ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: _ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_ <: L[_]]]]]]]]]]]]]]]]]]]]]]]]
+ = ??? } }
+