-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:typeclass-derivationbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement
Description
Compiler version
3.7.4, 3.8.0-RC1-bin-20251113-8b5d445-NIGHTLY
Minimized example
$ cat suggested_import.scala
import scala.deriving.Mirror
object test {
object Generic:
given fromMirror[M <: Mirror](using m: M): M = ???
trait TC[A]
summon[TC[Int]]
}Output Error/Warning message
$ scala-cli -S 3.nightly suggested_import.scala
Compiling project (Scala 3.8.0-RC1-bin-20251113-8b5d445-NIGHTLY, JVM (21))
[error] ./suggested_import.scala:8:18
[error] No given instance of type test.TC[Int] was found for parameter x of method summon in object Predef
[error]
[error] The following import might make progress towards fixing the problem:
[error]
[error] import test.Generic.fromMirror
[error]
[error] summon[TC[Int]]
[error] ^
Why this Error/Warning was not helpful
The message was unhelpful because importing fromMirror will not help.
Suggested improvement
It could be made more helpful by not suggesting anything. In the provided code there is not import that will help.
Metadata
Metadata
Assignees
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:typeclass-derivationbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement