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

Mocking classes with constructor params with applied types fails #519

Open
martijnhoekstra opened this issue May 19, 2024 · 0 comments · May be fixed by #520
Open

Mocking classes with constructor params with applied types fails #519

martijnhoekstra opened this issue May 19, 2024 · 0 comments · May be fixed by #520

Comments

@martijnhoekstra
Copy link
Contributor

ScalaMock Version (e.g. 3.5.0)

6.0.0

Scala Version (e.g. 2.12)

3.3.3

Runtime (JVM or JS)

JVM

Please describe the expected behavior of the issue

mocking classes with generic parameters works as expected

Please provide a description of what actually happens

compilation fails, with

Found:    Option
Required: Option[Int]

Reproducible Test Case

Please provide a minimised code snippet that fails, ideally, written as a failing test case in ScalaTest.
This will help us a lot in diagnosing the problem and work on a fix.
If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.

import org.scalamock.scalatest.MockFactory
import org.scalatest.funsuite.AnyFunSuite

class Example(opt: Option[Int])
class ReallySimpleExampleTest extends AnyFunSuite with MockFactory {
  test("example") {
    mock[Example]
  }
}

https://scastie.scala-lang.org/5NtYSNzkTImhshrePP6Mzg

@martijnhoekstra martijnhoekstra linked a pull request May 20, 2024 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant