title: ZIO Mock method that works with generics
body: <p>I'm trying to mock a service that has a generic method but I can't figure out how to define the effect in the mock. Can a generic effect even work? Are there any workarounds?</p>
  <p>The service:</p>
  <pre><code>object AService {
  
    type AService = Has[Service]
  
    trait Service {
      def add(n1: Int, n2: Int): Task[Int]
      def foo[A](n1: A, n2: A): Task[A]
    }
  
    def live: ULayer[Has[Service]] = ...
  }
  </code></pre>
  <p>The mock:</p>
  <pre><code>object AServiceMock extends Mock[AService] {
  
    object Add        extends Effect[(Int, Int), Nothing, Int]
    object Foo[T]     extends Effect[(T, T), Nothing, T]       // &lt;- Can I make something like this work?
  
    override protected[test] val compose = ZLayer.fromService {proxy =&gt;
      new AService.Service {
        override def add(n1: Int, n2: Int): Task[Int] = proxy(Add, n1, n2)
  
        override def foo[T](n1: T, n2: T): Task[T] = proxy(Foo, n1, n2)
      }
    }
  }
  </code></pre>
  <p>PS: I also tried with <code>@mockable[AService.Service]</code> but I receive: <em>&quot;exception during macro expansion: identifier expected but $XMLSTART$&lt; found&quot;</em></p>
  <p>Thanks</p>