Here is a simple example:
val a = 1
val b = 2
implicitly[a.type =:= b.type]
Generates the error::
[Error] /......:46: implicit error;
!I e (Cannot prove that a.type =:= b.type.): Int =:= Int
one error found
The first section Cannot prove that a.type =:= b.type is a customised implicitNotFound message, which is helpful, the second part Int =:= Int is added by splain, which is clueless.
If the ImplicitNotFound message hasn't been defined, or it is buried deep in a chain implicit resolution tree, there will be no way to figure out the cause.
My proposed fix is to show the full inheritance tree for not just the type, but all its parameters, e.g. for type a.type =:= b.type, the result should look like this:
-+ a.type =:= b.type
: `-+ [ 2 ARGS ] :
: !-+ a.type .................................................................................................................. [0]
: : !-+ Int ..................................................................................................................... [1]
: : !-+ AnyVal
: : !-- Any ..................................................................................................................... [2]
: !-+ b.type .................................................................................................................. [3]
: !-- Int ..................................................................................................................... [1]
!-+ a.type <:< b.type
: `-+ [ 2 ARGS ] :
: !-- a.type .................................................................................................................. [0]
: !-- b.type .................................................................................................................. [3]
!-+ java.io.Serializable
: !-- Any ..................................................................................................................... [2]
!-+ a.type => b.type
: `-+ [ 2 ARGS ] :
: !-- a.type .................................................................................................................. [0]
: !-- b.type .................................................................................................................. [3]
I already have the code extract the tree, I just don't know where to inject into your library. Could you point me to the right part of your code?
Here is a simple example:
Generates the error::
The first section
Cannot prove that a.type =:= b.typeis a customised implicitNotFound message, which is helpful, the second partInt =:= Intis added by splain, which is clueless.If the ImplicitNotFound message hasn't been defined, or it is buried deep in a chain implicit resolution tree, there will be no way to figure out the cause.
My proposed fix is to show the full inheritance tree for not just the type, but all its parameters, e.g. for type
a.type =:= b.type, the result should look like this:I already have the code extract the tree, I just don't know where to inject into your library. Could you point me to the right part of your code?