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

"Error while emitting" on wrong mock usage #499

Open
evis opened this issue Jan 15, 2024 · 1 comment
Open

"Error while emitting" on wrong mock usage #499

evis opened this issue Jan 15, 2024 · 1 comment
Labels

Comments

@evis
Copy link

evis commented Jan 15, 2024

ScalaMock Version (e.g. 3.5.0)

5.2.0

Scala Version (e.g. 2.12)

2.13.12

Runtime (JVM or JS)

JVM

Reproducible Test Case

File for scala-cli:

//> using scala 2.13.12
//> using dep org.scalamock::scalamock:5.2.0
//> using dep org.scalatest::scalatest:3.2.17
//> using options -Vprint:typer

trait A1
trait A2

trait A {
  def f(x: Int)(implicit a1: A1, a2: A2 = new A2 {})
}

import org.scalamock.scalatest.MockFactory

trait Test extends MockFactory {
  val aMock = mock[A]
  (aMock.f(_: Int)(_: A1)).expects(*, *) // here is a bug, A2 should be passed too
}

Please describe the expected behavior of the issue

Compilation fails with message, that A2 should be passed too.

Please provide a description of what actually happens

Compilation fails with unhelpful message:

scalac: Error while emitting Main.scala
value x$1

Original issue: scala/bug#12924

@goshacodes
Copy link
Contributor

Works with scala 3

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

No branches or pull requests

3 participants