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

@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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants