Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ollyw
Copy link
Contributor

@ollyw ollyw commented Feb 18, 2021

Implementation for #4718
This implementation seems to work, but am keen for advice on how to improve it. Perhaps there are some corner cases missed?

@ollyw ollyw force-pushed the add-poly-service-mockable-macro branch 2 times, most recently from 59301a0 to 9002068 Compare February 19, 2021 19:46
@jdegoes
Copy link
Member

jdegoes commented Mar 4, 2021

@ollyw Thanks for your work on this! Looks like the build has stalled. Can you force a rebuild by committing something benign?

@ollyw ollyw force-pushed the add-poly-service-mockable-macro branch from 9002068 to 6a92b87 Compare March 4, 2021 13:01
@ollyw ollyw force-pushed the add-poly-service-mockable-macro branch from 6a92b87 to 246f6f3 Compare March 4, 2021 13:08
@ollyw ollyw force-pushed the add-poly-service-mockable-macro branch from 5ba81b3 to f331271 Compare March 4, 2021 13:51
@ollyw
Copy link
Contributor Author

ollyw commented Mar 4, 2021

@jdegoes the build has past now. I think it had to do with the fact that CircleCI didn't have permissions on my github account

Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@aalbul
Copy link

aalbul commented Feb 13, 2022

Hi all. I know that it's already resolved, but I have some issues with the current implementation.
It doesn't allow to use of generic types in method parameters definitions.
For example, i tweaked the test case from ZIO codebase a bit to demonstrate it:

  trait Service[R, E, A] {
    val static: ZIO[R, E, A]
    def zeroParams: ZIO[R, E, A]
    def zeroParamsWithParens(): ZIO[R, E, A]
    def singleParam(a: Int): ZIO[R, E, A]
    def manyParams(a: Int, b: String, c: Long): ZIO[R, E, A]
    def manyParamLists(a: Int)(b: R)(c: Long): ZIO[R, E, A]
  }

As you see, manyParamLists accepts b as R now and this causes the following problem during compilation:

not found: type R
  case object ManyParamLists extends Effect[(Int, R, Long), Throwable, Double] 

Is it a known limitation or simply was not taken into account?

@ollyw
Copy link
Contributor Author

ollyw commented Feb 14, 2022

@aalbul the mockable macro has lots of more advanced cases that aren't currently supported. I have experimental version of the macro that I haven't upstreamed that supports a wider range of use cases. If I get some time this week I'll see if it supports your use case, and what effort it will take to upstream

@aalbul
Copy link

aalbul commented Feb 14, 2022

Cool! It would be great!

@ollyw
Copy link
Contributor Author

ollyw commented Apr 7, 2022

Sorry @aalbul, I didn't have time to look at this and am unlikely to get a chance to look again any time soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants