From 19fe058016a60c4193b0f8b1943069cda88bd237 Mon Sep 17 00:00:00 2001 From: Kai Date: Mon, 17 Feb 2020 20:56:30 +0000 Subject: [PATCH] Rename singular `.from`/`.add`,`.addSet` parameter from `instance` to `function` to reflect that it's suspended --- .../distage/model/definition/dsl/ModuleDefDSL.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala index 03b62d80d5..54e95a5c02 100644 --- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala +++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala @@ -99,8 +99,8 @@ object ModuleDefDSL { final def from[I <: T: Tag: AnyConstructor]: AfterBind = from(AnyConstructor[I].provider) - final def from[I <: T: Tag](instance: => I): AfterBind = - from(ProviderMagnet.lift(instance)) + final def from[I <: T: Tag](function: => I): AfterBind = + from(ProviderMagnet.lift(function)) final def fromValue[I <: T: Tag](instance: I): AfterBind = bind(ImplDef.InstanceImpl(SafeType.get[I], instance)) @@ -320,8 +320,8 @@ object ModuleDefDSL { final def add[I <: T: Tag: AnyConstructor](implicit pos: CodePositionMaterializer): AfterAdd = add[I](AnyConstructor[I].provider) - final def add[I <: T: Tag](instance: => I)(implicit pos: CodePositionMaterializer): AfterAdd = - add(ProviderMagnet.lift(instance)) + final def add[I <: T: Tag](function: => I)(implicit pos: CodePositionMaterializer): AfterAdd = + add(ProviderMagnet.lift(function)) final def addValue[I <: T: Tag](instance: I)(implicit pos: CodePositionMaterializer): AfterAdd = appendElement(ImplDef.InstanceImpl(SafeType.get[I], instance), pos) @@ -367,8 +367,8 @@ object ModuleDefDSL { * many[T].addSet(Set(new T, new T, new T)) * }}} **/ - final def addSet[I <: Set[_ <: T]: Tag](instance: => I)(implicit pos: CodePositionMaterializer): AfterMultiAdd = - addSet(ProviderMagnet.lift(instance)) + final def addSet[I <: Set[_ <: T]: Tag](function: => I)(implicit pos: CodePositionMaterializer): AfterMultiAdd = + addSet(ProviderMagnet.lift(function)) final def addSetValue[I <: Set[_ <: T]: Tag](instance: I)(implicit pos: CodePositionMaterializer): AfterMultiAdd = multiSetAdd(ImplDef.InstanceImpl(SafeType.get[I], instance), pos)