From 9f7bcf9662472cb70cf57f2cbc0b79938886a538 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Mon, 23 Dec 2024 20:11:36 +0000 Subject: [PATCH 1/2] extractSelf convenience helper --- .../distage/model/definition/dsl/AbstractBindingDefDSL.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala index 76d759a057..a93e378be7 100644 --- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala +++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala @@ -355,6 +355,10 @@ object AbstractBindingDefDSL { addOp(SubcontextInstruction.SetExtractor(f))(toSame) } + final def extractSelf: Self = { + addOp(SubcontextInstruction.SetExtractor(Functoid.identity[T]))(toSame) + } + final def localDependency[B: Tag]: Self = { localDependency(DIKey[B]) } From 1b2cbe8e740a9dfcdf78f0407a6cff4e1ccc74e0 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Mon, 23 Dec 2024 20:17:11 +0000 Subject: [PATCH 2/2] extractSelf convenience helper --- .../distage/model/definition/dsl/AbstractBindingDefDSL.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala index a93e378be7..0212ed3616 100644 --- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala +++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala @@ -355,7 +355,7 @@ object AbstractBindingDefDSL { addOp(SubcontextInstruction.SetExtractor(f))(toSame) } - final def extractSelf: Self = { + final def extractSelf(implicit t: Tag[T]): Self = { addOp(SubcontextInstruction.SetExtractor(Functoid.identity[T]))(toSame) }