summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorGregor Uhlenheuer <kongo2002@googlemail.com>2018-12-15 01:14:31 +0100
committerLi Haoyi <haoyi.sg@gmail.com>2018-12-14 16:14:31 -0800
commit9cbcfa9c1fb89efd0b4cdafdc4246ce027f74ebb (patch)
tree5a8ad5b5c48d7d515cea886b23fa617471f8f274 /main
parent293528734bb901d9d240782cde9e5f86221713a2 (diff)
downloadmill-9cbcfa9c1fb89efd0b4cdafdc4246ce027f74ebb.tar.gz
mill-9cbcfa9c1fb89efd0b4cdafdc4246ce027f74ebb.tar.bz2
mill-9cbcfa9c1fb89efd0b4cdafdc4246ce027f74ebb.zip
Discover - break overridesRoutes into fixed size chunks (#509)
* Discover - break overridesRoutes into fixed size chunks * Discover - simplify lambda creation * add LargeProjectTests * LargeProjectTests: remove Ydelambdafy
Diffstat (limited to 'main')
-rw-r--r--main/core/src/define/Discover.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/core/src/define/Discover.scala b/main/core/src/define/Discover.scala
index f0c668e6..c7dab54c 100644
--- a/main/core/src/define/Discover.scala
+++ b/main/core/src/define/Discover.scala
@@ -79,9 +79,12 @@ object Discover {
}
if overridesRoutes.nonEmpty
} yield {
+ // by wrapping the `overridesRoutes` in a lambda function we kind of work around
+ // the problem of generating a *huge* macro method body that finally exceeds the
+ // JVM's maximum allowed method size
+ val overridesLambda = q"(() => $overridesRoutes)()"
val lhs = q"classOf[${discoveredModuleType.typeSymbol.asClass}]"
- val rhs = q"scala.Seq[(Int, mill.util.Router.EntryPoint[_])](..$overridesRoutes)"
- q"$lhs -> $rhs"
+ q"$lhs -> $overridesLambda"
}
c.Expr[Discover[T]](q"mill.define.Discover(scala.collection.immutable.Map(..$mapping))")