weaver-test
weaver-test copied to clipboard
`expect` broken with `inline def` and `opaque type`
//> using lib "com.disneystreaming::weaver-cats:0.8.0"
//> using testFramework "weaver.framework.CatsEffect"
import weaver.*
opaque type Foo = Int
object Foo:
inline def fromInt(x: Int): Foo = x
inline def plus(x: Foo, y: Foo): Foo = x + y
object OpaqueSuite extends FunSuite:
test("asserts") {
val two: Foo = Foo.fromInt(2)
val three: Foo = Foo.fromInt(3)
val five: Foo = Foo.fromInt(5)
expect(Foo.plus(two, three) == five)
}
$ scala-cli test bug.scala
Compiling project (Scala 3.2.0, JVM)
[error] ./bug.scala:16:26: Found: (three : Foo)
[error] Required: Int
[error] expect(Foo.plus(two, three) == five)
[error] ^^^^^
Error compiling project (Scala 3.2.0, JVM)
Reproducible with vanilla Expecty ~~so I'm gonna transfer the issue there~~ lol, can't do that in a different org.
Anyways, it's a bug on Expecty, I'll take a look. I expect there to be a lot of these - we barely test new scala 3 features at all.
We can close this since it's not a bug here.