tek / splain

better implicit errors for scala
MIT License
370 stars 29 forks source link

Refined type signature may be hidden #102

Closed tribbloid closed 9 months ago

tribbloid commented 10 months ago

example:

object Refined2
{
  trait Node {
    type T
  }

  type NodeAux[T0] = Node { type T = T0 }
  type NodeLt[T0] = NodeAux[_ <: T0]

  implicitly[NodeLt[Int]]
}

which yields:

newSource1.scala:10: error: implicit error;
!I e: <refinement>
  implicitly[NodeLt[Int]]
            ^

The meaninglelss <refinement> is probably generated by the compiler

tribbloid commented 10 months ago

If not used in summoning it looks totally normal tho:


newSource1.scala:14: error: type mismatch;
  Int(1)|Refined2.Node {type T = _$2}
  val k: NodeLt[Int] = 1
                       ^

How weird