From 9f7bcf9662472cb70cf57f2cbc0b79938886a538 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Mon, 23 Dec 2024 20:11:36 +0000 Subject: [PATCH] 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]) }