diffx
diffx copied to clipboard
bad qualifier received: mkAttributedQualifier
I was able to reproduce an error that I encountered in a real project as a minmal example.
The example is here https://github.com/markus1189/diffx-test/blob/master/src/main/scala/example/Hello.scala
What's strange is that it works if the tagged type uses String instead of Int (Double breaks as well, maybe something involving AnyVal?)
The concrete error is:
[info] Compiling 1 Scala source to /tmp/bar/diffx-test/target/scala-2.13/classes ...
[error]
[error] bad qualifier received: mkAttributedQualifier(<notype>, <none>)
[error] while compiling: /tmp/bar/diffx-test/src/main/scala/example/Hello.scala
[error] during phase: typer
[error] library version: version 2.13.1
[error] compiler version: version 2.13.1
[error] reconstructed args: -bootclasspath /nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/lib/resources.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk
/jre/lib/rt.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/lib/sunrsasign.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/lib/jsse.jar:/nix/store
/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/lib/jce.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/lib/charsets.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf
6206-openjdk-8u222-ga/lib/openjdk/jre/lib/jfr.jar:/nix/store/lm5rrzcv6q4klcrrwh0dwv74pppf6206-openjdk-8u222-ga/lib/openjdk/jre/classes:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/s
cala-library/2.13.1/scala-library-2.13.1.jar -classpath /tmp/bar/diffx-test/target/scala-2.13/classes:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.1/scala-compil
er-2.13.1.jar:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/com/softwaremill/diffx/diffx-core_2.13/0
.3.17/diffx-core_2.13-0.3.17.jar:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/com/propensive/mercator_2.13/0.2.1/mercator_2.13-0.2.1.jar:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven
2/org/fusesource/jansi/jansi/1.12/jansi-1.12.jar:/home/markus/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.1/scala-reflect-2.13.1.jar:/home/markus/.coursier/cache/v1/https/rep
o1.maven.org/maven2/com/propensive/magnolia_2.13/0.12.6/magnolia_2.13-0.12.6.jar
[error]
[error] last tree to typer: Select(This(package diffx), Diff)
[error] tree position: line 29 of /tmp/bar/diffx-test/src/main/scala/example/Hello.scala
[error] tree tpe: com.softwaremill.diffx.Diff.type
[error] symbol: object Diff in package diffx
[error] symbol definition: object Diff (a ModuleSymbol)
[error] symbol package: com.softwaremill.diffx
[error] symbol owners: object Diff
[error] call site: object TestError in package example in package example
[error]
[error] == Source file context for tree position ==
[error]
[error] 26
[error] 27 val foo = Foo(Minute(5))
[error] 28
[error] 29 Diff[Foo].apply(foo, foo)
[error] 30 }
[error] 31
[error] /tmp/bar/diffx-test/src/main/scala/example/Hello.scala:29:7: could not find implicit value for evidence parameter of type com.softwaremill.diffx.Diff[example.TestError.Foo]
[error] Diff[Foo].apply(foo, foo)
[error] ^
[error] two errors found
Any ideas how to fix this?
This is probably a bug in magnolia. Thank you for this minimal example, it will definitely help to progress with it. I will try to take a look at it in the nearest future, but from my experience such bugs aren't easy to fix :(