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

Scala3 Intersection Type Issue #514

Closed
migiside opened this issue Mar 25, 2024 · 2 comments · Fixed by #515
Closed

Scala3 Intersection Type Issue #514

migiside opened this issue Mar 25, 2024 · 2 comments · Fixed by #515

Comments

@migiside
Copy link

Thank you for your work to support scala3!

ScalaMock Version (e.g. 3.5.0)

6.0.0-M2

Scala Version (e.g. 2.12)

3.3.3

Runtime (JVM or JS)

Eclipse Adoptium Java 21.0.2

Please describe the expected behavior of the issue

It should compile.

Please provide a description of what actually happens

compile error

[error] 25 |    val m = mock[Sample]
[error]    |                        ^
[error]    |                        Found:    (v : T & Base)
[error]    |                        Required: T² & Base
[error]    |
[error]    |                        where:    T  is a type in method f
[error]    |                                  T² is a type variable
[error]    |

Reproducible Test Case

trait Base

trait Sample {
  def f[T](v: T & Base): Unit
}

object Test extends AsyncFunSuite with AsyncMockFactory {
  
  test("intersection type") {

    val m = mock[Sample]

    succeed
  }
}
@goshacodes
Copy link
Contributor

Hi, thank you, fix is ready. We will publish it soon

@migiside
Copy link
Author

migiside commented Apr 2, 2024

Thanks for the quick fix!

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.

2 participants