7mind / izumi

Productivity-oriented collection of lightweight fancy stuff for Scala toolchain

Home Page:https://izumi.7mind.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Factories should produce better error messages for semi-compatible arguments

pshirshov opened this issue · comments

 trait Super
 trait Sub extends Super

 case class Output(s: Super)

  trait Factory {
    def make(arg: Sub): Output
  }

arg will not be captured by the macro and the error message isn't easy to read/interpret. We should improve the error message and, possibly, allow non-ambiguous subtypes in such cases.