diff options
author | Gregor Uhlenheuer <kongo2002@googlemail.com> | 2018-12-15 01:14:31 +0100 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-12-14 16:14:31 -0800 |
commit | 9cbcfa9c1fb89efd0b4cdafdc4246ce027f74ebb (patch) | |
tree | 5a8ad5b5c48d7d515cea886b23fa617471f8f274 /main/core/src/define | |
parent | 293528734bb901d9d240782cde9e5f86221713a2 (diff) | |
download | mill-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/core/src/define')
-rw-r--r-- | main/core/src/define/Discover.scala | 7 |
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))") |