Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functoid isolation #2106

Merged
merged 60 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f2d40ea
namings and packages: scala 2 macro universe isolated
pshirshov Apr 22, 2024
2cded91
wip
pshirshov Apr 22, 2024
4eecc07
wip
pshirshov Apr 22, 2024
9d65d85
wip
pshirshov Apr 22, 2024
2c77ee5
wip
pshirshov Apr 22, 2024
49999d8
wip
pshirshov Apr 23, 2024
65f196c
wip
pshirshov Apr 23, 2024
2cd11e7
wip
pshirshov Apr 23, 2024
78acd7d
proxy initialization improvements
pshirshov Apr 23, 2024
66651df
wip
pshirshov Apr 23, 2024
efc87b3
wip
pshirshov Apr 24, 2024
a6e322d
wip
pshirshov Apr 24, 2024
e3187ed
wip
pshirshov Apr 25, 2024
fe039a4
wip
pshirshov May 8, 2024
6c79576
wip
pshirshov May 27, 2024
4fdd5b2
wip
pshirshov May 27, 2024
63b8232
wip
pshirshov May 29, 2024
7ba1936
wip
pshirshov May 29, 2024
2067e96
wip
pshirshov May 29, 2024
89efa9f
wip
pshirshov May 29, 2024
bef9760
wip
pshirshov May 29, 2024
61791a9
wip
pshirshov May 31, 2024
f3fe196
wip
pshirshov May 31, 2024
b7906b2
wip
pshirshov Jun 3, 2024
913457f
wip
pshirshov Jun 3, 2024
be03bcc
wip
pshirshov Jun 3, 2024
dfe534f
wip
pshirshov Jun 3, 2024
ad00ff7
wip
pshirshov Jun 3, 2024
600c0e8
wip
pshirshov Jun 4, 2024
df20197
wip
pshirshov Jun 4, 2024
6f8d6c9
wip
pshirshov Jun 4, 2024
39d6921
wip
pshirshov Jun 4, 2024
c7c30ed
wip
pshirshov Jun 4, 2024
62757bc
wip
pshirshov Jun 4, 2024
b7c8e90
wip
pshirshov Jun 4, 2024
83a1692
wip
pshirshov Jun 4, 2024
2d9454f
2.12 fixes
pshirshov Jun 5, 2024
29330e5
wip
pshirshov Jun 5, 2024
ef13416
scala 3 fixed
pshirshov Jun 5, 2024
b452947
wip
pshirshov Jun 5, 2024
fafb7d6
wip
pshirshov Jun 5, 2024
2b6e7e0
wip
pshirshov Jun 5, 2024
eb3c419
wip
pshirshov Jun 5, 2024
61634e2
scala 3 done (more or less)
pshirshov Jun 5, 2024
50e3681
i/r 2.3.10
pshirshov Jun 5, 2024
6138542
fundamentals-functoid
pshirshov Jun 6, 2024
c4fde73
LifecycleTagMacro: add Try just in case
neko-kai Jun 7, 2024
45290f1
Make DIAnnotationMeta just a function
neko-kai Jun 7, 2024
9ebdfec
Return ProviderType.Singleton
neko-kai Jun 7, 2024
efc5b28
package-private `Functoid#returnTypeTag`
neko-kai Jun 7, 2024
a3c0f8e
Return DebugProperties for Functoid
neko-kai Jun 7, 2024
d71311c
remove asInstanceOfs, pass Functoid type in FunctoidMacroBase constru…
neko-kai Jun 7, 2024
b44fe4c
Cleanup and remove unused code
neko-kai Jun 12, 2024
d5d297c
Don't duplicate -Yretain-trees
neko-kai Jun 12, 2024
5cac779
fix PortableNamedArg non-exhaustive match
neko-kai Jun 12, 2024
a4c7132
revert change to lambda tpes - switch to lambda arg key type (exchang…
neko-kai Jun 12, 2024
7877dc7
Merge branch 'develop' into wip/functoid-refactorings
neko-kai Jun 12, 2024
a064989
fix merge error
neko-kai Jun 12, 2024
5c39ae9
Intellij highlighting and naming fix
neko-kai Jun 12, 2024
7dd03aa
fix 2.12 build
neko-kai Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,264 changes: 848 additions & 416 deletions build.sbt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package izumi.distage.constructors

import izumi.distage.constructors.macros.*
import izumi.distage.reflection.macros.constructors.*
import izumi.distage.model.definition.dsl.ModuleDefDSL
import izumi.distage.model.exceptions.macros.{TraitInitializationFailedException, UnsupportedDefinitionException}
import izumi.distage.model.providers.Functoid
Expand Down Expand Up @@ -105,12 +105,12 @@ object ZEnvConstructor {
implicit def materialize[T]: ZEnvConstructor[T] = macro ZEnvConstructorMacro.mkZEnvConstructor[T]
}

private[constructors] sealed trait ClassConstructorOptionalMakeDSL[T] extends Any {
private[distage] sealed trait ClassConstructorOptionalMakeDSL[T] extends Any {
def provider: Functoid[T]
}

object ClassConstructorOptionalMakeDSL {
private[constructors] final class Impl[T](val provider: Functoid[T]) extends AnyVal with ClassConstructorOptionalMakeDSL[T]
private[distage] final class Impl[T](val provider: Functoid[T]) extends AnyVal with ClassConstructorOptionalMakeDSL[T]

@inline def apply[T](functoid: Functoid[T]): ClassConstructorOptionalMakeDSL.Impl[T] = {
new ClassConstructorOptionalMakeDSL.Impl[T](functoid)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package izumi.distage.model.definition.dsl

import izumi.distage.constructors.macros.MakeMacro

import izumi.distage.reflection.macros.constructors.MakeMacro
import scala.language.experimental.macros

trait AbstractBindingDefDSLMacro[BindDSL[_]] {
final protected[this] def make[T]: BindDSL[T] = macro MakeMacro.make[BindDSL, T]
final protected def make[T]: BindDSL[T] = macro MakeMacro.make[BindDSL, T]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import scala.reflect.macros.blackbox
object LifecycleTagMacro {
def fakeResourceTagMacroIntellijWorkaroundImpl[R <: Lifecycle[Any, Any]: c.WeakTypeTag](c: blackbox.Context): c.Expr[Nothing] = {
val tagMacro = new TagMacro(c)
tagMacro.makeTagImpl[R] // run the macro AGAIN, to get a fresh error message
val _ = tagMacro.makeWeakTag[R] // run the macro AGAIN, to get a fresh error message
val tagTrace = tagMacro.getImplicitError()

c.abort(c.enclosingPosition, s"could not find implicit ResourceTag for ${c.universe.weakTypeOf[R]}!\n$tagTrace")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package izumi.distage.model.exceptions.reflection

import izumi.distage.model.exceptions.DIException
import izumi.distage.model.reflection.universe.DIUniverse
import izumi.distage.reflection.macros.universe.basicuniverse.MacroSafeType

class UnsupportedWiringException(message: String, val tpe: DIUniverse#SafeType) extends DIException(message)
class UnsupportedWiringException(message: String, val tpe: MacroSafeType) extends DIException(message)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package izumi.distage.reflection.macros

import izumi.distage.model.providers.Functoid
import izumi.distage.reflection.macros.universe.{DIAnnotationMeta, FunctoidMacroBase}

import scala.reflect.macros.blackbox

class FunctoidMacro(ctx: blackbox.Context) extends FunctoidMacroBase(ctx) {
override def tpe[A: c.WeakTypeTag]: c.Type = c.weakTypeOf[Functoid[A]]

override def idAnnotationFqn: String = new DIAnnotationMeta(ctx.universe).idAnnotationFqn
}
Loading
Loading