-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
dragons aheadTask which requires handwriting compiletime reflection for Scala2&3 and/or updating the architectureTask which requires handwriting compiletime reflection for Scala2&3 and/or updating the architectureenhancement
Description
Basically, implement regional flag from Ducktape.
It would be similar to implementation for current scoped flags (or local flags from Ducktape) which are implemented like
chimney/chimney/src/main/scala-2/io/scalaland/chimney/dsl/TransformerDefinition.scala
Lines 394 to 397 in a55f1df
| def withSourceFlag[T]( | |
| selectorFrom: From => T | |
| ): TransformerSourceFlagsDsl.OfTransformerDefinition[From, To, Overrides, Flags, ? <: Path] = | |
| macro TransformerDefinitionMacros.withSourceFlagImpl[From, To, Overrides, Flags] |
chimney/chimney/src/main/scala/io/scalaland/chimney/internal/runtime/TransformerFlags.scala
Lines 17 to 20 in a55f1df
| final class Source[SourcePath <: Path, SourceFlags <: TransformerFlags, Flags <: TransformerFlags] | |
| extends TransformerFlags | |
| final class Target[TargetPath <: Path, TargetFlags <: TransformerFlags, Flags <: TransformerFlags] | |
| extends TransformerFlags |
Lines 134 to 141 in a55f1df
| def prepareForRecursiveCall(fromPath: Path, toPath: Path)(implicit | |
| ctx: TransformationContext[?, ?] | |
| ): TransformerFlags = { | |
| val (immediate, nested) = scopedUpdates.view | |
| .flatMap { case (path, update) => path.drop(fromPath, toPath).map(_ -> update) } | |
| .partition(_._1.path == Path.Root) | |
| immediate.map(_._2).foldLeft(this)((f, u) => u(f)).copy(scopedUpdates = nested.toList) | |
| } |
(separate macro, returning a separate type, handled in Configuration).
Metadata
Metadata
Assignees
Labels
dragons aheadTask which requires handwriting compiletime reflection for Scala2&3 and/or updating the architectureTask which requires handwriting compiletime reflection for Scala2&3 and/or updating the architectureenhancement