Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

@mockable failing on literal-type type parameters #40

Open
ThijsBroersen opened this issue Dec 19, 2022 · 4 comments
Open

@mockable failing on literal-type type parameters #40

ThijsBroersen opened this issue Dec 19, 2022 · 4 comments

Comments

@ThijsBroersen
Copy link

ThijsBroersen commented Dec 19, 2022

I am getting the an error when generating a mock for this:

case class Context[T](value: String)

@accessible
trait ServiceX {
  def doSomething: RIO[Context[123], Unit]
}

@mockable[ServiceX]
object ServiceXMock

error

[E]      exception during macro expansion: 
[E]      scala.reflect.macros.ParseException: ']' expected but '(' found.
[E]             at scala.reflect.macros.contexts.Parsers.$anonfun$parse$1(Parsers.scala:35)
[E]             at scala.reflect.macros.contexts.Parsers.$anonfun$parse$1$adapted(Parsers.scala:34)
[E]             at scala.collection.mutable.LinkedHashSet.foreach(LinkedHashSet.scala:127)
[E]             at scala.reflect.macros.contexts.Parsers.parse(Parsers.scala:34)
[E]             at scala.reflect.macros.contexts.Parsers.parse$(Parsers.scala:25)
[E]             at scala.reflect.macros.contexts.Context.parse(Context.scala:18)
[E]             at scala.reflect.macros.contexts.Context.parse(Context.scala:18)
[E]             at zio.mock.MockableMacro$.impl(MockableMacro.scala:357)
@ThijsBroersen
Copy link
Author

ThijsBroersen commented Dec 19, 2022

Update: any literal type parameter seems to fail:

@accessible
trait ServiceX {
  def doSomething: RIO[123, Unit]
}

@mockable[ServiceX]
object ServiceXMock

@avner-unit
Copy link

@ThijsBroersen - Hi! Have to managed to solve it? I have the same issue

@ThijsBroersen
Copy link
Author

@ThijsBroersen - Hi! Have to managed to solve it? I have the same issue

No, sorry.

@avner-unit
Copy link

it's a bug and I don't think the contributors here are on the issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants