Repository: 7mind/izumi
Pull request #704 (2019-10-23 23:51:48)

Merge distage-static into distage-core


Patch:
diff --git a/build.sbt b/build.sbt
index 2a403bbee..4983e40a4 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1722,132 +1722,10 @@ lazy val `distage-roles` = project.in(file("distage/distage-roles"))
   )
   .disablePlugins(AssemblyPlugin)
 
-lazy val `distage-static` = project.in(file("distage/distage-static"))
-  .dependsOn(
-    `distage-core` % "test->test;compile->compile",
-    `distage-roles` % "test->compile,test"
-  )
-  .settings(
-    libraryDependencies ++= Seq(
-      compilerPlugin("org.typelevel" % "kind-projector" % V.kind_projector cross CrossVersion.full),
-      "org.scala-lang.modules" %% "scala-collection-compat" % V.collection_compat,
-      "org.scalatest" %% "scalatest" % V.scalatest % Test
-    )
-  )
-  .settings(
-    organization := "io.7mind.izumi",
-    unmanagedSourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/scala" ,
-    unmanagedResourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/resources" ,
-    unmanagedSourceDirectories in Test += baseDirectory.value / ".jvm/src/test/scala" ,
-    unmanagedResourceDirectories in Test += baseDirectory.value / ".jvm/src/test/resources" ,
-    scalacOptions ++= Seq(
-      s"-Xmacro-settings:scala-version=${scalaVersion.value}",
-      s"-Xmacro-settings:scala-versions=${crossScalaVersions.value.mkString(":")}"
-    ),
-    testOptions in Test += Tests.Argument("-oDF"),
-    scalacOptions ++= { (isSnapshot.value, scalaVersion.value) match {
-      case (_, "2.12.10") => Seq(
-        "-Xsource:2.13",
-        "-Ybackend-parallelism",
-        "8",
-        "-explaintypes",
-        "-Ypartial-unification",
-        "-Yno-adapted-args",
-        "-Xlint:adapted-args",
-        "-Xlint:by-name-right-associative",
-        "-Xlint:constant",
-        "-Xlint:delayedinit-select",
-        "-Xlint:doc-detached",
-        "-Xlint:inaccessible",
-        "-Xlint:infer-any",
-        "-Xlint:missing-interpolator",
-        "-Xlint:nullary-override",
-        "-Xlint:nullary-unit",
-        "-Xlint:option-implicit",
-        "-Xlint:package-object-classes",
-        "-Xlint:poly-implicit-overload",
-        "-Xlint:private-shadow",
-        "-Xlint:stars-align",
-        "-Xlint:type-parameter-shadow",
-        "-Xlint:unsound-match",
-        "-opt-warnings:_",
-        "-Ywarn-extra-implicit",
-        "-Ywarn-unused:_",
-        "-Ywarn-adapted-args",
-        "-Ywarn-dead-code",
-        "-Ywarn-inaccessible",
-        "-Ywarn-infer-any",
-        "-Ywarn-nullary-override",
-        "-Ywarn-nullary-unit",
-        "-Ywarn-numeric-widen",
-        "-Ywarn-unused-import",
-        "-Ywarn-value-discard"
-      )
-      case (_, "2.12.8") => Seq(
-        "-Xsource:2.13",
-        "-Ybackend-parallelism",
-        "8",
-        "-explaintypes",
-        "-Ypartial-unification",
-        "-Yno-adapted-args",
-        "-Xlint:adapted-args",
-        "-Xlint:by-name-right-associative",
-        "-Xlint:constant",
-        "-Xlint:delayedinit-select",
-        "-Xlint:doc-detached",
-        "-Xlint:inaccessible",
-        "-Xlint:infer-any",
-        "-Xlint:missing-interpolator",
-        "-Xlint:nullary-override",
-        "-Xlint:nullary-unit",
-        "-Xlint:option-implicit",
-        "-Xlint:package-object-classes",
-        "-Xlint:poly-implicit-overload",
-        "-Xlint:private-shadow",
-        "-Xlint:stars-align",
-        "-Xlint:type-parameter-shadow",
-        "-Xlint:unsound-match",
-        "-opt-warnings:_",
-        "-Ywarn-extra-implicit",
-        "-Ywarn-unused:_",
-        "-Ywarn-adapted-args",
-        "-Ywarn-dead-code",
-        "-Ywarn-inaccessible",
-        "-Ywarn-infer-any",
-        "-Ywarn-nullary-override",
-        "-Ywarn-nullary-unit",
-        "-Ywarn-numeric-widen",
-        "-Ywarn-unused-import",
-        "-Ywarn-value-discard"
-      )
-      case (_, "2.13.1") => Seq(
-        "-Xsource:2.13",
-        "-Ybackend-parallelism",
-        "8",
-        "-explaintypes",
-        "-Xlint:_",
-        "-Wunused:_",
-        "-Wdead-code",
-        "-Wextra-implicit",
-        "-Wnumeric-widen",
-        "-Woctal-literal",
-        "-Wvalue-discard"
-      )
-      case (_, _) => Seq.empty
-    } },
-    scalaVersion := crossScalaVersions.value.head,
-    crossScalaVersions := Seq(
-      "2.12.10",
-      "2.13.1"
-    )
-  )
-  .disablePlugins(AssemblyPlugin)
-
 lazy val `distage-testkit` = project.in(file("distage/distage-testkit"))
   .dependsOn(
     `distage-config` % "test->compile;compile->compile",
     `distage-roles` % "test->compile;compile->compile",
-    `distage-static` % "test->compile;compile->compile",
     `logstage-di` % "test->compile;compile->compile",
     `distage-core` % "test->test;compile->compile",
     `distage-plugins` % "test->test;compile->compile"
@@ -4097,7 +3975,6 @@ lazy val `microsite` = project.in(file("doc/microsite"))
     `distage-roles-api` % "test->compile;compile->compile",
     `distage-plugins` % "test->compile;compile->compile",
     `distage-roles` % "test->compile;compile->compile",
-    `distage-static` % "test->compile;compile->compile",
     `distage-testkit` % "test->compile;compile->compile",
     `logstage-api` % "test->compile;compile->compile",
     `logstage-core` % "test->compile;compile->compile",
@@ -4460,7 +4337,6 @@ lazy val `distage` = (project in file(".agg/distage-distage"))
     `distage-roles-api`,
     `distage-plugins`,
     `distage-roles`,
-    `distage-static`,
     `distage-testkit`
   )
 
@@ -4482,7 +4358,6 @@ lazy val `distage-jvm` = (project in file(".agg/distage-distage-jvm"))
     `distage-roles-api`,
     `distage-plugins`,
     `distage-roles`,
-    `distage-static`,
     `distage-testkit`
   )
 
diff --git a/distage/distage-core/src/main/scala/distage/Distage.scala b/distage/distage-core/src/main/scala/distage/Distage.scala
index 2d61cb18d..b502b6e95 100644
--- a/distage/distage-core/src/main/scala/distage/Distage.scala
+++ b/distage/distage-core/src/main/scala/distage/Distage.scala
@@ -18,6 +18,8 @@ trait Distage {
   type DIResource[+F[_], Resource] = model.definition.DIResource[F, Resource]
   val DIResource: model.definition.DIResource.type = model.definition.DIResource
 
+  type DIResourceBase[+F[_], +Resource] = model.definition.DIResource.DIResourceBase[F, Resource]
+
   type Planner = model.Planner
   type Locator = model.Locator
   type Producer = model.Producer
diff --git a/distage/distage-core/src/main/scala/distage/package.scala b/distage/distage-core/src/main/scala/distage/package.scala
index 8ad89f2b9..ce43807b5 100644
--- a/distage/distage-core/src/main/scala/distage/package.scala
+++ b/distage/distage-core/src/main/scala/distage/package.scala
@@ -16,6 +16,8 @@ package object distage extends Distage {
   override type DIResource[+F[_], Resource] = model.definition.DIResource[F, Resource]
   override val DIResource: model.definition.DIResource.type = model.definition.DIResource
 
+  override type DIResourceBase[+F[_], +Resource] = model.definition.DIResource.DIResourceBase[F, Resource]
+
   override type Planner = model.Planner
   override type Locator = model.Locator
   override type Producer = model.Producer
diff --git a/distage/distage-core/src/main/scala/izumi/distage/constructors/DebugProperties.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/DebugProperties.scala
new file mode 100644
index 000000000..3fd6f0cdb
--- /dev/null
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/DebugProperties.scala
@@ -0,0 +1,7 @@
+package izumi.distage.constructors
+
+import izumi.fundamentals.platform
+
+object DebugProperties extends platform.logging.DebugProperties {
+  final val `izumi.debug.macro.distage.constructors` = "izumi.debug.macro.distage.constructors"
+}
diff --git a/distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticDSL.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/StaticDSL.scala
similarity index 78%
rename from distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticDSL.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/StaticDSL.scala
index 150814b29..c37b76c88 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticDSL.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/StaticDSL.scala
@@ -1,13 +1,13 @@
-package izumi.distage.model.definition
+package izumi.distage.constructors
 
+import izumi.distage.constructors.StaticDSL.{StaticBindDSL, StaticBinding, StaticSetDSL}
 import izumi.distage.model.definition.Binding.ImplBinding
-import izumi.distage.model.definition.StaticDSL.{StaticBindDSL, StaticBinding, StaticSetDSL}
 import izumi.distage.model.definition.dsl.ModuleDefDSL.{BindDSLBase, SetDSLBase}
 import izumi.distage.model.reflection.universe.RuntimeDIUniverse.Tag
-import izumi.distage.provisioning.AnyConstructor
 
 import scala.language.implicitConversions
 
+@deprecated("will be replaced", "0.10")
 trait StaticDSL {
 
   @inline implicit final def ToMagicBindDSL[T, AfterBind](dsl: BindDSLBase[T, AfterBind]): StaticBindDSL[T, AfterBind] =
@@ -23,17 +23,17 @@ trait StaticDSL {
 object StaticDSL extends StaticDSL {
 
   final class StaticBindDSL[T, AfterBind](private val dsl: BindDSLBase[T, AfterBind]) extends AnyVal {
-    def stat[I <: T: Tag: AnyConstructor]: AfterBind =
+    def stat[I <: T : Tag : AnyConstructor]: AfterBind =
       dsl.from[I](AnyConstructor[I].provider)
   }
 
   final class StaticSetDSL[T, AfterAdd, AfterMultiAdd](private val dsl: SetDSLBase[T, AfterAdd, AfterMultiAdd]) extends AnyVal {
-    def addStatic[I <: T: Tag: AnyConstructor]: AfterAdd =
+    def addStatic[I <: T : Tag : AnyConstructor]: AfterAdd =
       dsl.add[I](AnyConstructor[I].provider)
   }
 
   final class StaticBinding(private val binding: ImplBinding) extends AnyVal {
-    def withStaticImpl[T: Tag: AnyConstructor]: ImplBinding =
+    def withStaticImpl[T: Tag : AnyConstructor]: ImplBinding =
       binding.withImpl[T](AnyConstructor[T].provider)
   }
 
diff --git a/distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticModuleDef.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/StaticModuleDef.scala
similarity index 74%
rename from distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticModuleDef.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/StaticModuleDef.scala
index 9abfd50df..567a7f09b 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/model/definition/StaticModuleDef.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/StaticModuleDef.scala
@@ -1,10 +1,11 @@
-package izumi.distage.model.definition
+package izumi.distage.constructors
 
+import izumi.distage.model.definition.ModuleDef
 import izumi.distage.model.reflection.universe.RuntimeDIUniverse.Tag
-import izumi.distage.provisioning.AnyConstructor
 import izumi.fundamentals.platform.language.CodePositionMaterializer
 
 // TODO: improve
+@deprecated("will be replaced", "0.10")
 trait StaticModuleDef extends ModuleDef with StaticDSL {
 
   final def stat[T: Tag: AnyConstructor](implicit pos: CodePositionMaterializer): Unit = {
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/AnyConstructor.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/constructors.scala
similarity index 61%
rename from distage/distage-static/src/main/scala/izumi/distage/provisioning/AnyConstructor.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/constructors.scala
index 9770c3102..7daf7737b 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/AnyConstructor.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/constructors.scala
@@ -1,42 +1,39 @@
-package izumi.distage.provisioning
+package izumi.distage.constructors
 
+import izumi.distage.constructors.`macro`.{AnyConstructorMacro, ConcreteConstructorMacro, FactoryConstructorMacro, TraitConstructorMacro}
 import izumi.distage.model.providers.ProviderMagnet
-import izumi.distage.provisioning.strategies.{AnyConstructorMacro, ConcreteConstructorMacro, FactoryConstructorMacro, TraitConstructorMacro}
 
 import scala.language.experimental.macros
 
 sealed trait AnyConstructor[T] {
   def provider: ProviderMagnet[T]
 }
-
 final case class ConcreteConstructor[T](provider: ProviderMagnet[T]) extends AnyConstructor[T]
-
 final case class TraitConstructor[T](provider: ProviderMagnet[T]) extends AnyConstructor[T]
-
 final case class FactoryConstructor[T](provider: ProviderMagnet[T]) extends AnyConstructor[T]
 
 object AnyConstructor {
   def apply[T: AnyConstructor]: AnyConstructor[T] = implicitly
 
-  implicit def derive[T]: AnyConstructor[T] = macro AnyConstructorMacro.mkAnyConstructor[T]
-
   def generateUnsafeWeakSafeTypes[T]: AnyConstructor[T] = macro AnyConstructorMacro.mkAnyConstructorUnsafeWeakSafeTypes[T]
+
+  implicit def materialize[T]: AnyConstructor[T] = macro AnyConstructorMacro.mkAnyConstructor[T]
 }
 
 object ConcreteConstructor {
   def apply[T: ConcreteConstructor]: ConcreteConstructor[T] = implicitly
 
-  implicit def derive[T]: ConcreteConstructor[T] = macro ConcreteConstructorMacro.mkConcreteConstructor[T]
+  implicit def materialize[T]: ConcreteConstructor[T] = macro ConcreteConstructorMacro.mkConcreteConstructor[T]
 }
 
 object TraitConstructor {
   def apply[T: TraitConstructor]: TraitConstructor[T] = implicitly
 
-  implicit def derive[T]: TraitConstructor[T] = macro TraitConstructorMacro.mkTraitConstructor[T]
+  implicit def materialize[T]: TraitConstructor[T] = macro TraitConstructorMacro.mkTraitConstructor[T]
 }
 
 object FactoryConstructor {
   def apply[T: FactoryConstructor]: FactoryConstructor[T] = implicitly
 
-  implicit def derive[T]: FactoryConstructor[T] = macro FactoryConstructorMacro.mkFactoryConstructor[T]
+  implicit def materialize[T]: FactoryConstructor[T] = macro FactoryConstructorMacro.mkFactoryConstructor[T]
 }
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/AnyConstructorMacro.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/AnyConstructorMacro.scala
similarity index 94%
rename from distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/AnyConstructorMacro.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/macro/AnyConstructorMacro.scala
index 80565bd60..900461243 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/AnyConstructorMacro.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/AnyConstructorMacro.scala
@@ -1,7 +1,7 @@
-package izumi.distage.provisioning.strategies
+package izumi.distage.constructors.`macro`
 
+import izumi.distage.constructors.AnyConstructor
 import izumi.distage.model.reflection.universe.StaticDIUniverse
-import izumi.distage.provisioning.AnyConstructor
 import izumi.distage.reflection.SymbolIntrospectorDefaultImpl
 
 import scala.reflect.macros.blackbox
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/ConcreteConstructorMacro.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/ConcreteConstructorMacro.scala
similarity index 92%
rename from distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/ConcreteConstructorMacro.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/macro/ConcreteConstructorMacro.scala
index 7f53910da..e76ef8a24 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/ConcreteConstructorMacro.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/ConcreteConstructorMacro.scala
@@ -1,15 +1,13 @@
-package izumi.distage.provisioning.strategies
+package izumi.distage.constructors.`macro`
 
+import izumi.distage.constructors.{ConcreteConstructor, DebugProperties}
 import izumi.distage.model.providers.ProviderMagnet
 import izumi.distage.model.reflection.universe.StaticDIUniverse
-import izumi.distage.provisioning.ConcreteConstructor
 import izumi.distage.reflection.{DependencyKeyProviderDefaultImpl, ReflectionProviderDefaultImpl, SymbolIntrospectorDefaultImpl}
 import izumi.fundamentals.reflection.{AnnotationTools, TrivialMacroLogger}
 
 import scala.reflect.macros.blackbox
 
-
-
 object ConcreteConstructorMacro {
 
   def mkConcreteConstructor[T: c.WeakTypeTag](c: blackbox.Context): c.Expr[ConcreteConstructor[T]] = mkConcreteConstructorImpl[T](c, generateUnsafeWeakSafeTypes = false)
@@ -23,7 +21,7 @@ object ConcreteConstructorMacro {
     val symbolIntrospector = SymbolIntrospectorDefaultImpl.Static(macroUniverse)
     val keyProvider = DependencyKeyProviderDefaultImpl.Static(macroUniverse)(symbolIntrospector)
     val reflectionProvider = ReflectionProviderDefaultImpl.Static(macroUniverse)(keyProvider, symbolIntrospector)
-    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.static`)
+    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.constructors`)
 
     val targetType = weakTypeOf[T]
 
@@ -43,10 +41,9 @@ object ConcreteConstructorMacro {
 
         p.wireWith.tpe.use {
           tpe =>
-          q"$mods val $name: $tpe" -> name
+            q"$mods val $name: $tpe" -> name
         }
 
-
     })
 
     val args = fnArgsNamesLists.flatten.unzip._1
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/FactoryConstructorMacro.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/FactoryConstructorMacro.scala
similarity index 92%
rename from distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/FactoryConstructorMacro.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/macro/FactoryConstructorMacro.scala
index aeb02dc42..84324ba9c 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/FactoryConstructorMacro.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/FactoryConstructorMacro.scala
@@ -1,10 +1,11 @@
-package izumi.distage.provisioning.strategies
+package izumi.distage.constructors.`macro`
 
+import izumi.distage.constructors.{AnyConstructor, DebugProperties, FactoryConstructor}
 import izumi.distage.model.providers.ProviderMagnet
 import izumi.distage.model.provisioning.strategies.FactoryExecutor
 import izumi.distage.model.reflection.macros.DIUniverseLiftables
 import izumi.distage.model.reflection.universe.{RuntimeDIUniverse, StaticDIUniverse}
-import izumi.distage.provisioning.{AnyConstructor, FactoryConstructor, FactoryTools}
+import izumi.distage.provisioning.FactoryTools
 import izumi.distage.reflection.{DependencyKeyProviderDefaultImpl, ReflectionProviderDefaultImpl, SymbolIntrospectorDefaultImpl}
 import izumi.fundamentals.reflection.{AnnotationTools, ReflectionUtil, TrivialMacroLogger}
 
@@ -20,7 +21,7 @@ object FactoryConstructorMacro {
     val symbolIntrospector = SymbolIntrospectorDefaultImpl.Static(macroUniverse)
     val keyProvider = DependencyKeyProviderDefaultImpl.Static(macroUniverse)(symbolIntrospector)
     val reflectionProvider = ReflectionProviderDefaultImpl.Static(macroUniverse)(keyProvider, symbolIntrospector)
-    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.static`)
+    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.constructors`)
 
     // A hack to support generic methods inside factories. No viable type info is available for generic parameters of these methods
     // so we have to resort to WeakTypeTags and thread this ugly fucking `if` everywhere ;_;
@@ -86,7 +87,6 @@ object FactoryConstructorMacro {
           }
           """)
 
-
         val providedKeys = method.associationsFromContext.map(_.wireWith)
 
         // TODO: remove ReflectiveInstantiationWiring by generating providers for factory products too, so that the only wiring allowed is Function
@@ -95,9 +95,9 @@ object FactoryConstructorMacro {
           val wiring = ${_unsafeWrong_convertReflectiveWiringToFunctionWiring(productConstructor)}
 
           ${reify(RuntimeDIUniverse.Wiring.FactoryFunction.FactoryMethod)}.apply(
-            ${factoryMethod: SymbolInfo}
+            ${liftableSymbolInfo(factoryMethod)}
             , wiring
-            , wiring.associations.map(_.wireWith) diff ${providedKeys.toList} // work hard to ensure pointer equality of dikeys...
+            , wiring.associations.map(_.wireWith) diff ${Liftable.liftList(liftableBasicDIKey)(providedKeys.toList)} // work hard to ensure pointer equality of dikeys...
           )
         }"""
 
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/TraitConstructorMacro.scala b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/TraitConstructorMacro.scala
similarity index 92%
rename from distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/TraitConstructorMacro.scala
rename to distage/distage-core/src/main/scala/izumi/distage/constructors/macro/TraitConstructorMacro.scala
index eb5d912d0..bd189c2a5 100644
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/TraitConstructorMacro.scala
+++ b/distage/distage-core/src/main/scala/izumi/distage/constructors/macro/TraitConstructorMacro.scala
@@ -1,8 +1,8 @@
-package izumi.distage.provisioning.strategies
+package izumi.distage.constructors.`macro`
 
+import izumi.distage.constructors.{DebugProperties, TraitConstructor}
 import izumi.distage.model.providers.ProviderMagnet
 import izumi.distage.model.reflection.universe.StaticDIUniverse
-import izumi.distage.provisioning.TraitConstructor
 import izumi.distage.reflection.{DependencyKeyProviderDefaultImpl, ReflectionProviderDefaultImpl, SymbolIntrospectorDefaultImpl}
 import izumi.fundamentals.reflection.{AnnotationTools, ReflectionUtil, TrivialMacroLogger}
 
@@ -16,14 +16,14 @@ object TraitConstructorMacro {
     import c.universe._
 
     val macroUniverse = StaticDIUniverse(c)
-    import macroUniverse._
-    import macroUniverse.Wiring._
     import macroUniverse.Association._
+    import macroUniverse.Wiring._
+    import macroUniverse._
 
     val symbolIntrospector = SymbolIntrospectorDefaultImpl.Static(macroUniverse)
     val keyProvider = DependencyKeyProviderDefaultImpl.Static(macroUniverse)(symbolIntrospector)
     val reflectionProvider = ReflectionProviderDefaultImpl.Static(macroUniverse)(keyProvider, symbolIntrospector)
-    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.static`)
+    val logger = TrivialMacroLogger.make[this.type](c, DebugProperties.`izumi.debug.macro.distage.constructors`)
 
     val targetType = weakTypeOf[T]
 
@@ -48,8 +48,10 @@ object TraitConstructorMacro {
     else
       q"new ..$parents { ..$wireMethods }"
 
-    val constructorDef = q"""
-      ${if (wireArgs.nonEmpty)
+    val constructorDef =
+      q"""
+      ${
+        if (wireArgs.nonEmpty)
           q"def constructor(..$wireArgs): $targetType = ($instantiate): $targetType"
         else
           q"def constructor: $targetType = ($instantiate): $targetType"
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/definition/ImplDef.scala b/distage/distage-model/src/main/scala/izumi/distage/model/definition/ImplDef.scala
index 3f8e0cf7b..93fdb893b 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/definition/ImplDef.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/definition/ImplDef.scala
@@ -10,16 +10,12 @@ object ImplDef {
   sealed trait DirectImplDef extends ImplDef
 
   final case class ReferenceImpl(implType: SafeType, key: DIKey, weak: Boolean) extends DirectImplDef
-
   final case class TypeImpl(implType: SafeType) extends DirectImplDef
-
   final case class InstanceImpl(implType: SafeType, instance: Any) extends DirectImplDef
-
   final case class ProviderImpl(implType: SafeType, function: Provider) extends DirectImplDef
 
   sealed trait RecursiveImplDef extends ImplDef
 
   final case class EffectImpl(implType: SafeType, effectHKTypeCtor: SafeType, effectImpl: DirectImplDef) extends RecursiveImplDef
-
   final case class ResourceImpl(implType: SafeType, effectHKTypeCtor: SafeType, resourceImpl: DirectImplDef) extends RecursiveImplDef
 }
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/definition/ModuleBase.scala b/distage/distage-model/src/main/scala/izumi/distage/model/definition/ModuleBase.scala
index ec3913779..def45d06a 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/definition/ModuleBase.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/definition/ModuleBase.scala
@@ -2,7 +2,6 @@ package izumi.distage.model.definition
 
 import cats.Hash
 import cats.kernel.{BoundedSemilattice, PartialOrder}
-import izumi.distage.model.definition.ModuleBase.ModuleBaseInstances.{CatsBoundedSemilattice, CatsPartialOrderHash, ModuleBaseSemilattice}
 import izumi.distage.model.definition.ModuleBaseInstances.{CatsBoundedSemilattice, CatsPartialOrderHash, ModuleBaseSemilattice}
 import izumi.distage.model.reflection.universe.RuntimeDIUniverse.DIKey
 import izumi.fundamentals.collections.IzCollections._
@@ -120,7 +119,7 @@ object ModuleBase {
               existingMappings
             } else {
               // merge tags wrt strange Binding equals
-                modulewiseMerge(newMappings, existingMappings.filter(m => newMappings.map(_.group).contains(m.group)))
+              modulewiseMerge(newMappings, existingMappings.filter(m => newMappings.map(_.group).contains(m.group)))
             }
         }
 
@@ -149,7 +148,7 @@ object ModuleBase {
   }
 
   /** Optional instance via https://blog.7mind.io/no-more-orphans.html */
-  implicit def optionalCatsPartialOrderHashForModuleBase[T <: ModuleBase, K[_]: CatsPartialOrderHash]: K[T] = {
+  implicit def optionalCatsPartialOrderHashForModuleBase[T <: ModuleBase, K[_] : CatsPartialOrderHash]: K[T] = {
     import cats.instances.set._
 
     new PartialOrder[T] with Hash[T] {
@@ -160,7 +159,7 @@ object ModuleBase {
   }
 
   /** Optional instance via https://blog.7mind.io/no-more-orphans.html */
-  implicit def optionalCatsSemilatticeForModuleBase[T <: ModuleBase.Aux[T]: ModuleMake, K[_]: CatsBoundedSemilattice]: K[T] =
+  implicit def optionalCatsSemilatticeForModuleBase[T <: ModuleBase.Aux[T] : ModuleMake, K[_] : CatsBoundedSemilattice]: K[T] =
     new ModuleBaseSemilattice[T].asInstanceOf[K[T]]
 
 }
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/provisioning/strategies/ProxyDispatcher.scala b/distage/distage-model/src/main/scala/izumi/distage/model/provisioning/strategies/ProxyDispatcher.scala
index b0617c43d..5e938fcad 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/provisioning/strategies/ProxyDispatcher.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/provisioning/strategies/ProxyDispatcher.scala
@@ -24,8 +24,8 @@ trait AtomicProxyDispatcher extends ProxyDispatcher {
   }
 }
 
-class ByNameDispatcher(val key: DIKey)
-  extends Function0[Any]
+final class ByNameDispatcher(val key: DIKey)
+  extends (() => Any)
     with AtomicProxyDispatcher {
   override def apply(): Any = {
     Option(reference.get()) match {
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/macros/ProviderMagnetMacro.scala b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/macros/ProviderMagnetMacro.scala
index b8bfaf4d8..a8a540b78 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/macros/ProviderMagnetMacro.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/macros/ProviderMagnetMacro.scala
@@ -3,8 +3,7 @@ package izumi.distage.model.reflection.macros
 import izumi.distage.model.providers.ProviderMagnet
 import izumi.distage.model.reflection.universe.{RuntimeDIUniverse, StaticDIUniverse}
 import izumi.distage.reflection.{DependencyKeyProviderDefaultImpl, SymbolIntrospectorDefaultImpl}
-import izumi.fundamentals.reflection.macrortti.LightTypeTag
-import izumi.fundamentals.reflection.{AnnotationTools, DebugProperties, TrivialMacroLogger}
+import izumi.fundamentals.reflection.{AnnotationTools, TrivialMacroLogger}
 
 import scala.reflect.macros.blackbox
 
@@ -13,11 +12,11 @@ final class ProviderMagnetMacroGenerateUnsafeWeakSafeTypes(override val c: black
 }
 
 /**
-* To see macro debug output during compilation, set `-Dizumi.debug.macro.rtti=true` java property! e.g.
-* {{{
-* sbt -Dizumi.debug.macro.rtti=true compile
-* }}}
-*/
+  * To see macro debug output during compilation, set `-Dizumi.debug.macro.rtti=true` java property! e.g.
+  * {{{
+  * sbt -Dizumi.debug.macro.rtti=true compile
+  * }}}
+  */
 // TODO: bench and optimize
 class ProviderMagnetMacro(val c: blackbox.Context) {
 
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDICallable.scala b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDICallable.scala
index 655cb689d..250e148bf 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDICallable.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDICallable.scala
@@ -26,7 +26,7 @@ trait WithDICallable {
       fun(args)
     }
 
-    private def verifyArgs(refs: Seq[TypedRef[_]]): Seq[Any] = {
+    private[this] def verifyArgs(refs: Seq[TypedRef[_]]): Seq[Any] = {
       val countOk = refs.size == argTypes.size
 
       val typesOk = argTypes.zip(refs).forall {
@@ -40,15 +40,16 @@ trait WithDICallable {
         args
       } else {
         throw new UnsafeCallArgsMismatched(
-          s"""Mismatched arguments for unsafe call:
-             | ${if(!typesOk) "Wrong types!" else ""}
-             | ${if(!countOk) s"Expected number of arguments ${argTypes.size}, but got ${refs.size}" else ""}
-             |Expected types [${argTypes.mkString(",")}], got types [${types.mkString(",")}], values: (${args.mkString(",")})""".stripMargin
-          , argTypes
-          , types
-          , args)
+          message =
+            s"""Mismatched arguments for unsafe call:
+               | ${if (!typesOk) "Wrong types!" else ""}
+               | ${if (!countOk) s"Expected number of arguments ${argTypes.size}, but got ${refs.size}" else ""}
+               |Expected types [${argTypes.mkString(",")}], got types [${types.mkString(",")}], values: (${args.mkString(",")})""".stripMargin,
+          expected = argTypes,
+          actual = types,
+          actualValues = args,
+        )
       }
-
     }
   }
 
@@ -61,34 +62,33 @@ trait WithDICallable {
     override final val argTypes: Seq[SafeType] = associations.map(_.wireWith.tpe)
     override final val arity: Int = argTypes.size
 
-    override def toString: String =
+    override final def toString: String =
       s"$fun(${argTypes.mkString(", ")}): $ret"
   }
 
   object Provider {
 
-    case class ProviderImpl[+R](
-                                 associations: Seq[Association.Parameter]
-                               , ret: SafeType
-                               , fun: Seq[Any] => Any
+    case class ProviderImpl[+A](
+                                 associations: Seq[Association.Parameter],
+                                 ret: SafeType,
+                                 fun: Seq[Any] => Any,
                                ) extends Provider {
 
-      override final def unsafeApply(refs: TypedRef[_]*): R =
-        super.unsafeApply(refs: _*).asInstanceOf[R]
+      override final def unsafeApply(refs: TypedRef[_]*): A =
+        super.unsafeApply(refs: _*).asInstanceOf[A]
 
       override final def unsafeMap(newRet: SafeType, f: Any => _): ProviderImpl[_] =
         copy(ret = newRet, fun = xs => f.apply(fun(xs)))
 
       override final def unsafeZip(newRet: SafeType, that: Provider): Provider =
         ProviderImpl(
-          associations ++ that.associations
-          , newRet
-          , { args0 =>
+          associations ++ that.associations,
+          newRet,
+          { args0 =>
             val (args1, args2) = args0.splitAt(arity)
             fun(args1) -> that.fun(args2)
-          }
+          },
         )
-
     }
 
     object ProviderImpl {
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISafeType.scala b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISafeType.scala
index 85c35a9e2..aa21492a2 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISafeType.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISafeType.scala
@@ -8,7 +8,7 @@ trait WithDISafeType {
     with WithTags =>
 
   // TODO: hotspot, hashcode on keys is inefficient
-  case class SafeType protected(override val tpe: TypeNative, override val tag: LightTypeTag) extends SafeType0[u.type](tpe, tag)
+  case class SafeType protected (override val tpe: TypeNative, override val tag: LightTypeTag) extends SafeType0[u.type](tpe, tag)
 
   object SafeType {
     // FIXME TODO constructing SafeType from a runtime type tag
diff --git a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISymbolInfo.scala b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISymbolInfo.scala
index d50011633..3d9eb7bb0 100644
--- a/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISymbolInfo.scala
+++ b/distage/distage-model/src/main/scala/izumi/distage/model/reflection/universe/WithDISymbolInfo.scala
@@ -7,7 +7,7 @@ trait WithDISymbolInfo {
   this: DIUniverseBase
     with WithDISafeType =>
 
-  trait SymbolInfo {
+  sealed trait SymbolInfo {
     def name: String
 
     def finalResultType: SafeType
@@ -58,7 +58,7 @@ trait WithDISymbolInfo {
                        , annotations: List[u.Annotation]
                        , definingClass: SafeType
                        , isByName: Boolean
-                       , wasGeneric: Boolean
+                       , wasGeneric: Boolean,
                      ) extends SymbolInfo
 
     def apply(symb: Symb, definingClass: SafeType, wasGeneric: Boolean): SymbolInfo = Runtime(symb, definingClass, wasGeneric)
diff --git a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/DebugProperties.scala b/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/DebugProperties.scala
deleted file mode 100644
index 35b12ae0f..000000000
--- a/distage/distage-static/src/main/scala/izumi/distage/provisioning/strategies/DebugProperties.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-package izumi.distage.provisioning.strategies
-
-import izumi.fundamentals.platform.logging.DebugProperties
-
-object DebugProperties extends DebugProperties {
-  final val `izumi.debug.macro.distage.static` = "izumi.debug.macro.distage.static"
-}
diff --git a/doc/microsite/src/main/tut/distage/cookbook.md b/doc/microsite/src/main/tut/distage/cookbook.md
index 512ad623d..95cbaedef 100644
--- a/doc/microsite/src/main/tut/distage/cookbook.md
+++ b/doc/microsite/src/main/tut/distage/cookbook.md
@@ -30,7 +30,7 @@ val module1 = new ModuleDef {
 }
 ```
 
-Function and instance bindings and also compile-time mode in `distage-static` module do not require the type prefix:
+Function and instance bindings and constructors generated by implicit @scaladoc[AnyConstructor](izumi.distage.constructors.AnyConstructor) do not require the type prefix:
 
 ```scala mdoc
 val module2 = new ModuleDef {
diff --git a/doc/microsite/src/main/tut/distage/debugging.md b/doc/microsite/src/main/tut/distage/debugging.md
index c984f1627..4f37c5ab7 100644
--- a/doc/microsite/src/main/tut/distage/debugging.md
+++ b/doc/microsite/src/main/tut/distage/debugging.md
@@ -34,8 +34,6 @@ you can turn on macro debug output during compilation by setting `-Dizumi.debug.
 sbt -Dizumi.debug.macro.rtti=true compile
 ```
 
-Macros power `distage-static` module, an alternative backend that does not use JVM runtime reflection to instantiate classes and auto-traits.
-
 ### Graphviz rendering
 
 Add `GraphDumpBootstrapModule` to your `Injector`'s configuration to enable dumping of graphviz files with a graphical representation of the `Plan`.
diff --git a/doc/microsite/src/main/tut/distage/other-features.md b/doc/microsite/src/main/tut/distage/other-features.md
index d1f28a73b..04b459ca0 100644
--- a/doc/microsite/src/main/tut/distage/other-features.md
+++ b/doc/microsite/src/main/tut/distage/other-features.md
@@ -104,7 +104,7 @@ class ActorFactoryImpl(sessionStorage: SessionStorage) extends ActorFactory {
 You can use this feature to concisely provide non-singleton semantics for some of your components.
 
 By default, the factory implementation class will be created automatically at runtime.
-To create factories at compile-time use `distage-static` module.
+To create factories at compile-time summon an implicit @scaladoc[FactoryConstructor](izumi.distage.constructors.FactoryConstructor) for your type.
 
 ### Plugins
 
diff --git a/doc/microsite/src/main/tut/izumi.md b/doc/microsite/src/main/tut/izumi.md
index 0e8c939ce..d9badf49e 100644
--- a/doc/microsite/src/main/tut/izumi.md
+++ b/doc/microsite/src/main/tut/izumi.md
@@ -27,8 +27,6 @@ libraryDependencies ++= Seq(
   "io.7mind.izumi" %% "distage-core" % "$izumi.version$",
   // Testkit for ScalaTest
   "io.7mind.izumi" %% "distage-testkit" % "$izumi.version$" % Test,
-  // Compile-time checks & reflection-less mode
-  "io.7mind.izumi" %% "distage-static" % "$izumi.version$",
   // Typesafe Config support
   "io.7mind.izumi" %% "distage-config" % "$izumi.version$",
   // Classpath discovery support
diff --git a/fundamentals/fundamentals-reflection/src/main/scala/izumi/fundamentals/reflection/DebugProperties.scala b/fundamentals/fundamentals-reflection/src/main/scala/izumi/fundamentals/reflection/DebugProperties.scala
index 1f18cbb4f..f866bf79f 100644
--- a/fundamentals/fundamentals-reflection/src/main/scala/izumi/fundamentals/reflection/DebugProperties.scala
+++ b/fundamentals/fundamentals-reflection/src/main/scala/izumi/fundamentals/reflection/DebugProperties.scala
@@ -1,6 +1,6 @@
 package izumi.fundamentals.reflection
 
-import izumi.fundamentals.platform.logging.DebugProperties
+import izumi.fundamentals.platform
 
 /**
   * To see macro debug output during compilation, set `-Dizumi.debug.macro.rtti=true` java property! e.g.
@@ -8,6 +8,6 @@ import izumi.fundamentals.platform.logging.DebugProperties
   * sbt -Dizumi.debug.macro.rtti=true compile
   * }}}
   */
-object DebugProperties extends DebugProperties {
+object DebugProperties extends platform.logging.DebugProperties {
   final val `izumi.debug.macro.rtti` = "izumi.debug.macro.rtti"
 }
diff --git a/project/Deps.sc b/project/Deps.sc
index 9c0823c0b..15ce77fd0 100644
--- a/project/Deps.sc
+++ b/project/Deps.sc
@@ -1,4 +1,4 @@
-import $ivy.`io.7mind.izumi.sbt::sbtgen:0.0.38`
+import $ivy.`io.7mind.izumi.sbt::sbtgen:0.0.39`
 import izumi.sbtgen._
 import izumi.sbtgen.model._
 
@@ -268,7 +268,6 @@ object Izumi {
       final lazy val rolesApi = ArtifactId("distage-roles-api")
       final lazy val plugins = ArtifactId("distage-plugins")
       final lazy val roles = ArtifactId("distage-roles")
-      final lazy val static = ArtifactId("distage-static")
       final lazy val testkit = ArtifactId("distage-testkit")
     }
 
@@ -426,16 +425,11 @@ object Izumi {
         depends = Seq(Projects.distage.rolesApi, Projects.logstage.di, Projects.logstage.adapterSlf4j, Projects.logstage.renderingCirce).map(_ in Scope.Compile.all) ++
           Seq(Projects.distage.core, Projects.distage.plugins, Projects.distage.config).map(_ tin Scope.Compile.all),
       ),
-      Artifact(
-        name = Projects.distage.static,
-        libs = Seq.empty,
-        depends = Seq(Projects.distage.core).map(_ tin Scope.Compile.all) ++ Seq(Projects.distage.roles).map(_ tin Scope.Test.all),
-      ),
       Artifact(
         name = Projects.distage.testkit,
         libs = Seq(scalatest.dependency in Scope.Compile.all) ++ allMonads,
         depends =
-          Seq(Projects.distage.config, Projects.distage.roles, Projects.distage.static, Projects.logstage.di).map(_ in Scope.Compile.all) ++
+          Seq(Projects.distage.config, Projects.distage.roles, Projects.logstage.di).map(_ in Scope.Compile.all) ++
             Seq(Projects.distage.core, Projects.distage.plugins).map(_ tin Scope.Compile.all),
         settings = Seq(
           "classLoaderLayeringStrategy" in SettingScope.Test := "ClassLoaderLayeringStrategy.Flat".raw,
diff --git a/project/Versions.scala b/project/Versions.scala
index d59f052b0..65eda0b29 100644
--- a/project/Versions.scala
+++ b/project/Versions.scala
@@ -18,7 +18,7 @@ object V {
   val zio_interop_cats = "2.0.0.0-RC6"
 
   val circe = "0.12.3"
-  val circe_generic_extras = "0.12.3"
+  val circe_generic_extras = "0.12.2"
   val circe_derivation = "0.12.0-M7"
   val jawn = "0.14.2"
 


Test patch:
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticConfigTest.scala b/distage/distage-config/src/test/scala/izumi/distage/config/StaticConfigTest.scala
similarity index 87%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticConfigTest.scala
rename to distage/distage-config/src/test/scala/izumi/distage/config/StaticConfigTest.scala
index d065d4c76..ed5f61a13 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticConfigTest.scala
+++ b/distage/distage-config/src/test/scala/izumi/distage/config/StaticConfigTest.scala
@@ -1,12 +1,12 @@
-package izumi.distage.staticinjector
+package izumi.distage.config
 
+import com.typesafe.config.ConfigFactory
+import distage.Id
 import izumi.distage.config.annotations.AutoConf
 import izumi.distage.config.model.AppConfig
-import izumi.distage.config.{ConfigFixtures, ConfigModule}
+import izumi.distage.constructors.StaticModuleDef
+import izumi.distage.injector.MkInjector
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
-import com.typesafe.config.ConfigFactory
-import distage.Id
 import org.scalatest.WordSpec
 
 class StaticConfigTest extends WordSpec with MkInjector {
@@ -15,7 +15,7 @@ class StaticConfigTest extends WordSpec with MkInjector {
     import ConfigFixtures._
 
     val config = AppConfig(ConfigFactory.load("macro-fixtures-test.conf"))
-    val injector = mkInjector(new ConfigModule(config))
+    val injector = mkStaticInjector(new ConfigModule(config))
 
     val definition = new StaticModuleDef {
       stat[TestDependency]
@@ -33,7 +33,7 @@ class StaticConfigTest extends WordSpec with MkInjector {
     import ConfigFixtures._
 
     val config = AppConfig(ConfigFactory.load("macro-fixtures-test.conf"))
-    val injector = mkInjector(new ConfigModule(config))
+    val injector = mkStaticInjector(new ConfigModule(config))
 
     val definition = new StaticModuleDef {
       stat[TestDependency]
@@ -51,7 +51,7 @@ class StaticConfigTest extends WordSpec with MkInjector {
     import ConfigFixtures._
 
     val config = AppConfig(ConfigFactory.load("macro-fixtures-test.conf"))
-    val injector = mkInjector(new ConfigModule(config))
+    val injector = mkStaticInjector(new ConfigModule(config))
 
     val definition = new StaticModuleDef {
       stat[TestDependency]
@@ -76,12 +76,12 @@ class StaticConfigTest extends WordSpec with MkInjector {
     import ConfigFixtures._
 
     val config = AppConfig(ConfigFactory.load("macro-fixtures-test.conf"))
-    val injector = mkInjector(new ConfigModule(config))
+    val injector = mkStaticInjector(new ConfigModule(config))
 
     val definition = new StaticModuleDef {
       make[Int].named("depInt").from(5)
       make[ConcreteProduct].from {
-        (conf: TestConf @AutoConf, i: Int @Id("depInt")) => ConcreteProduct(conf, i * 10)
+        (conf: TestConf@AutoConf, i: Int@Id("depInt")) => ConcreteProduct(conf, i * 10)
       }
     }
     val plan = injector.plan(PlannerInput.noGc(definition))
diff --git a/distage/distage-static/src/test/scala/izumi/distage/StaticDSLTest.scala b/distage/distage-core/src/test/scala/izumi/distage/StaticDSLTest.scala
similarity index 95%
rename from distage/distage-static/src/test/scala/izumi/distage/StaticDSLTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/StaticDSLTest.scala
index 810cebe83..fcdc24eb6 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/StaticDSLTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/StaticDSLTest.scala
@@ -1,8 +1,8 @@
 package izumi.distage
 
-import izumi.distage.fixtures.BasicCases._
-import izumi.distage.model.definition.StaticDSL._
 import distage.{ModuleBase, ModuleDef}
+import izumi.distage.constructors.StaticDSL._
+import izumi.distage.fixtures.BasicCases._
 import org.scalatest.WordSpec
 
 class StaticDSLTest extends WordSpec {
diff --git a/distage/distage-core/src/test/scala/izumi/distage/injector/MkInjector.scala b/distage/distage-core/src/test/scala/izumi/distage/injector/MkInjector.scala
index b13b5825b..e0e505f19 100644
--- a/distage/distage-core/src/test/scala/izumi/distage/injector/MkInjector.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/injector/MkInjector.scala
@@ -1,7 +1,9 @@
 package izumi.distage.injector
 
-import distage.Injector
+import distage.{BootstrapModule, Injector}
 
 trait MkInjector {
   def mkInjector(): Injector = Injector.Standard()
+  def mkStaticInjector(overrides: BootstrapModule*): Injector = Injector.NoCogen(overrides: _*)
+  def mkInjectorWithProxy(): Injector = Injector.Standard()
 }
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala
similarity index 92%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala
index ef64edb8c..bd06d3d51 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoFactoriesTest.scala
@@ -1,8 +1,9 @@
 package izumi.distage.staticinjector
 
+import izumi.distage.constructors.StaticModuleDef
 import izumi.distage.fixtures.FactoryCases.FactoryCase1
+import izumi.distage.injector.MkInjector
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import org.scalatest.WordSpec
 
 class MacroAutoFactoriesTest extends WordSpec with MkInjector {
@@ -18,7 +19,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
       stat[AbstractFactory]
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
@@ -52,7 +53,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
       make[Dependency].from(ConcreteDep())
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
@@ -71,7 +72,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
       make[Dependency].from(ConcreteDep())
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
@@ -90,7 +91,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
       make[Dependency].named("veryspecial").from(VerySpecialDep())
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
@@ -110,7 +111,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
         |  stat[Dependency]
         |}
         |
-        |val injector = mkInjector()
+        |val injector = mkStaticInjector()
         |val plan = injector.plan(definition)
         |val context = injector.produce(plan)
         |
@@ -130,7 +131,7 @@ class MacroAutoFactoriesTest extends WordSpec with MkInjector {
       stat[Factory]
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala
similarity index 91%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala
index df8a9c4d9..4968705cb 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/MacroAutoTraitsTest.scala
@@ -1,12 +1,12 @@
 package izumi.distage.staticinjector
 
+import izumi.distage.constructors.{AnyConstructor, StaticModuleDef}
 import izumi.distage.fixtures.TraitCases.TraitCase4.Trait
 import izumi.distage.fixtures.TraitCases.{TraitCase1, TraitCase2, TraitCase4, TraitCase5}
 import izumi.distage.fixtures.TypesCases.TypesCase3
+import izumi.distage.injector.MkInjector
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import org.scalatest.WordSpec
-import izumi.distage.provisioning.AnyConstructor
 import izumi.distage.model.reflection.universe.RuntimeDIUniverse.TypedRef
 
 class MacroAutoTraitsTest extends WordSpec with MkInjector {
@@ -28,7 +28,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[TestTrait]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -45,7 +45,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       make[TestTrait].named("named-trait").stat[TestTrait]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -66,7 +66,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Dependency1]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -92,7 +92,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Dependency1]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -109,7 +109,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Dep]
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
     val instantiated = context.get[TestTraitAny {def dep: Dep}]
@@ -126,7 +126,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Trait2 with (Trait2 with (Trait2 with Trait1))]
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
@@ -146,7 +146,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Trait1]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -169,7 +169,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[Dep]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -187,7 +187,7 @@ class MacroAutoTraitsTest extends WordSpec with MkInjector {
       stat[TestTrait]
     })
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(definition)
     val context = injector.produceUnsafe(plan)
 
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala
similarity index 95%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala
index dcd3e803d..e17ab40d1 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticCircularDependenciesTest.scala
@@ -2,8 +2,9 @@ package izumi.distage.staticinjector
 
 import izumi.distage.fixtures.CircularCases.{CircularCase1, CircularCase2}
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import distage.ModuleBase
+import izumi.distage.constructors.StaticModuleDef
+import izumi.distage.injector.MkInjector
 import org.scalatest.WordSpec
 
 class StaticCircularDependenciesTest extends WordSpec with MkInjector {
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala
similarity index 92%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala
index dc0e13ae7..4c8908acf 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticHigherKindsTest.scala
@@ -2,8 +2,9 @@ package izumi.distage.staticinjector
 
 import izumi.distage.fixtures.HigherKindCases.HigherKindsCase1
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import distage.{Id, TagK}
+import izumi.distage.constructors.StaticModuleDef
+import izumi.distage.injector.MkInjector
 import org.scalatest.WordSpec
 
 class StaticHigherKindsTest extends WordSpec with MkInjector {
@@ -30,7 +31,7 @@ class StaticHigherKindsTest extends WordSpec with MkInjector {
       make[F[Either[Int, F[String]]]].from(Pointed[F].point(Right[Int, F[String]](Pointed[F].point("hello")): Either[Int, F[String]]))
     }
 
-    val listInjector = mkInjector()
+    val listInjector = mkStaticInjector()
     val listPlan = listInjector.plan(PlannerInput.noGc(Definition[List](5)))
     val listContext = listInjector.produceUnsafe(listPlan)
 
@@ -43,7 +44,7 @@ class StaticHigherKindsTest extends WordSpec with MkInjector {
     assert(listContext.get[Either[String, List[Int]]] == Right(List(1)))
     assert(listContext.get[List[Either[Int, List[String]]]] == List(Right(List("hello"))))
 
-    val optionTInjector = mkInjector()
+    val optionTInjector = mkStaticInjector()
     val optionTPlan = optionTInjector.plan(PlannerInput.noGc(Definition[OptionT[List, ?]](5)))
     val optionTContext = optionTInjector.produceUnsafe(optionTPlan)
 
@@ -52,7 +53,7 @@ class StaticHigherKindsTest extends WordSpec with MkInjector {
     assert(optionTContext.get[TestServiceTrait[OptionT[List, ?]]].get == OptionT(List(Option(10))))
     assert(optionTContext.get[OptionT[List, String]] == OptionT(List(Option("Hello 5!"))))
 
-    val idInjector = mkInjector()
+    val idInjector = mkStaticInjector()
     val idPlan = idInjector.plan(PlannerInput.noGc(Definition[id](5)))
     val idContext = idInjector.produceUnsafe(idPlan)
 
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala
similarity index 88%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala
index 0ad6210e8..c1428f852 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticImplicitInjectionTest.scala
@@ -1,8 +1,9 @@
 package izumi.distage.staticinjector
 
+import izumi.distage.constructors.StaticModuleDef
 import izumi.distage.fixtures.ImplicitCases.ImplicitCase2
+import izumi.distage.injector.MkInjector
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import org.scalatest.WordSpec
 
 class StaticImplicitInjectionTest extends WordSpec with MkInjector {
@@ -10,7 +11,7 @@ class StaticImplicitInjectionTest extends WordSpec with MkInjector {
   "Handle multiple parameter lists" in {
     import ImplicitCase2._
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
 
     val definition = new StaticModuleDef {
       stat[TestDependency1]
@@ -30,7 +31,7 @@ class StaticImplicitInjectionTest extends WordSpec with MkInjector {
   "Implicit parameters are injected from the DI object graph, not from Scala's lexical implicit scope" in {
     import ImplicitCase2._
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
 
     val definition = new StaticModuleDef {
       implicit val testDependency3: TestDependency3 = new TestDependency3
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala
similarity index 86%
rename from distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala
rename to distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala
index d5317fcc4..c3ce41d9d 100644
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala
+++ b/distage/distage-core/src/test/scala/izumi/distage/staticinjector/StaticInnerClassesTest.scala
@@ -1,8 +1,9 @@
 package izumi.distage.staticinjector
 
+import izumi.distage.constructors.StaticModuleDef
 import izumi.distage.fixtures.InnerClassCases.{InnerClassStablePathsCase, InnerClassUnstablePathsCase}
+import izumi.distage.injector.MkInjector
 import izumi.distage.model.PlannerInput
-import izumi.distage.model.definition.StaticModuleDef
 import org.scalatest.WordSpec
 
 class StaticInnerClassesTest extends WordSpec with MkInjector {
@@ -13,7 +14,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
       stat[TopLevelPathDepTest.TestDependency]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -35,7 +36,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
       stat[testModule.TestDependency]
     }
 
-    val injector = mkInjector()
+    val injector = mkStaticInjector()
     val plan = injector.plan(PlannerInput.noGc(definition))
 
     val context = injector.produceUnsafe(plan)
@@ -51,7 +52,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
       stat[TestDependency]
     }
 
-    val context = mkInjector().produceUnsafe(PlannerInput.noGc(definition))
+    val context = mkStaticInjector().produceUnsafe(PlannerInput.noGc(definition))
 
     assert(context.get[TestDependency] == TestDependency())
   }
@@ -65,7 +66,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
       stat[TestClass]
     }
 
-    val context = mkInjector().produceUnsafe(PlannerInput.noGc(definition))
+    val context = mkStaticInjector().produceUnsafe(PlannerInput.noGc(definition))
 
     assert(context.get[TestClass] == TestClass(TestDependency()))
   }
@@ -79,7 +80,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
         stat[TestFactory]
       }
 
-      val context = mkInjector().produce(PlannerInput.noGc(definition))
+      val context = mkStaticInjector().produce(PlannerInput.noGc(definition))
 
       assert(context.get[TestFactory].mk(TestDependency()) == TestClass(TestDependency()))
       """)
@@ -92,7 +93,7 @@ class StaticInnerClassesTest extends WordSpec with MkInjector {
     }
 
     def testCase = {
-      val injector = mkInjector()
+      val injector = mkStaticInjector()
       val plan = injector.plan(PlannerInput.noGc(definition))
 
       val context = injector.produceUnsafe(plan)
diff --git a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MkInjector.scala b/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MkInjector.scala
deleted file mode 100644
index d7ecf721a..000000000
--- a/distage/distage-static/src/test/scala/izumi/distage/staticinjector/MkInjector.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-package izumi.distage.staticinjector
-
-
-import distage.{Injector, BootstrapModule}
-
-trait MkInjector {
-
-  def mkInjector(overrides: BootstrapModule*): Injector = Injector.NoCogen(overrides: _*)
-
-  def mkInjectorWithProxy(): Injector = Injector.Standard()
-
-}
diff --git a/distage/distage-testkit/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala b/distage/distage-testkit/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala
index 4f20c3c9d..b265315ba 100644
--- a/distage/distage-testkit/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala
+++ b/distage/distage-testkit/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala
@@ -1,8 +1,8 @@
 package izumi.distage.testkit.services
 
 import distage.Tag
+import izumi.distage.constructors.TraitConstructor
 import izumi.distage.model.providers.ProviderMagnet
-import izumi.distage.provisioning.TraitConstructor
 import zio.{IO, ZIO}
 
 import scala.language.implicitConversions