You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<macro>:5:37: type arguments [A] do not conform to trait BoundedType's type parameter bounds [A <: AnyRef]
[error] final def polyBoundedIn[A](a: BoundedType[A])(implicit evidence$1: zio.EnvironmentTag[A]): _root_.zio.ZIO[Any, Nothing, Unit] = proxy(TestServiceMock.PolyBoundedIn.of[BoundedType[A]], a)
The first branch TypeTree() matches and as a result the A <: Something becomes just A in the macro definition. That becomes noticeable when the parameter of the mocked method has itself a type paramater that must respect the bound, like in my example above.
I don't know macros enough to know what happens removing that "bound" function and simply always doing case TypeBounds(lo, hi) => tq"$lo" -> tq"$hi". I tried to modify the code and all the tests seem to pass (including a new one for the failing case), but I really don't know why that replacement with EmptyTree was there in the first place so I haven't opened a pull request for it.
If you need any more information, let me know!
The text was updated successfully, but these errors were encountered:
The following code does not compile on the latest 1.0.0-RC5 (and I think on any other version):
and the mock :
The compiler error:
The problem seems to be in this part of the macro
zio-mock/mock/shared/src/main/scala-2/zio/mock/MockableMacro.scala
Line 69 in e437c0a
and in particular the
bound
function:The first branch
TypeTree()
matches and as a result theA <: Something
becomes justA
in the macro definition. That becomes noticeable when the parameter of the mocked method has itself a type paramater that must respect the bound, like in my example above.I don't know macros enough to know what happens removing that "bound" function and simply always doing
case TypeBounds(lo, hi) => tq"$lo" -> tq"$hi"
. I tried to modify the code and all the tests seem to pass (including a new one for the failing case), but I really don't know why that replacement with EmptyTree was there in the first place so I haven't opened a pull request for it.If you need any more information, let me know!
The text was updated successfully, but these errors were encountered: