-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workaround 3.2 regression, finalize Selectable arg selectors
- Loading branch information
Showing
18 changed files
with
188 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 28 additions & 23 deletions
51
ducktape/src/main/scala/io/github/arainko/ducktape/builder/DefinitionViaBuilder.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
// package io.github.arainko.ducktape.builder | ||
package io.github.arainko.ducktape.builder | ||
|
||
// import io.github.arainko.ducktape.* | ||
// import io.github.arainko.ducktape.internal.macros.* | ||
// import scala.deriving.* | ||
// import io.github.arainko.ducktape.function.FunctionMirror | ||
import io.github.arainko.ducktape.* | ||
import io.github.arainko.ducktape.internal.macros.* | ||
import scala.deriving.* | ||
import io.github.arainko.ducktape.function.* | ||
|
||
// sealed abstract class DefinitionViaBuilder[Source, Dest, Func, NamedArguments <: Tuple](function: Func) { | ||
sealed abstract class DefinitionViaBuilder[Source, Dest, Func, ArgSelector <: FunctionArguments](function: Func) { | ||
|
||
// inline def build( | ||
// inline config: ArgBuilderConfig[Source, Dest, NamedArguments]* | ||
// )(using Mirror.ProductOf[Source]): Transformer[Source, Dest] = from => | ||
// ProductTransformerMacros.viaConfigured[Source, Dest, Func, NamedArguments](from, function, config*) | ||
// } | ||
inline def build( | ||
inline config: ArgBuilderConfig[Source, Dest, ArgSelector]* | ||
)(using Mirror.ProductOf[Source]): Transformer[Source, Dest] = from => | ||
ProductTransformerMacros.viaConfigured[Source, Dest, Func, ArgSelector](from, function, config*) | ||
} | ||
|
||
// object DefinitionViaBuilder { | ||
// def create[Source]: PartiallyApplied[Source] = () | ||
object DefinitionViaBuilder { | ||
private[DefinitionViaBuilder] class Impl[Source, Dest, Func, ArgSelector <: FunctionArguments]( | ||
function: Func | ||
) extends DefinitionViaBuilder[Source, Dest, Func, ArgSelector](function) | ||
|
||
// opaque type PartiallyApplied[Source] = Unit | ||
def create[Source]: PartiallyApplied[Source] = () | ||
|
||
// object PartiallyApplied { | ||
// extension [Source](partial: PartiallyApplied[Source]) { | ||
// transparent inline def apply[Func](inline func: Func)(using Func: FunctionMirror[Func]) = { | ||
// val builder = new DefinitionViaBuilder[Source, Func.Return, Func, Nothing](func) {} | ||
// FunctionMacros.namedArguments(func, builder) | ||
// } | ||
// } | ||
// } | ||
// } | ||
opaque type PartiallyApplied[Source] = Unit | ||
|
||
object PartiallyApplied { | ||
extension [Source](partial: PartiallyApplied[Source]) { | ||
transparent inline def apply[Func](inline func: Func)(using Func: FunctionMirror[Func]) = { | ||
// widen the type to not infer `DefinitionViaBuilder.Impl`, we're in a transparent inline method after all | ||
val builder: DefinitionViaBuilder[Source, Func.Return, Func, Nothing] = Impl(func) | ||
FunctionMacros.namedArguments(func, builder) | ||
} | ||
} | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
ducktape/src/main/scala/io/github/arainko/ducktape/function/FunctionArgSelector.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
ducktape/src/main/scala/io/github/arainko/ducktape/function/NamedArgument.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.