Skip to content

Bad error message when taking Tuple.IsMappedBy as evidence #22607

Open
@eejbyfeldt

Description

@eejbyfeldt

Compiler version

3.6.3

Minimized example

trait TC[X]

object Test:
  def f[T <: Tuple: Tuple.IsMappedBy[TC]](t: T) = ???
  
  f(1 *: EmptyTuple)

Output Error/Warning message

-- [E172] Type Error: /home/ejbyfeldt/dev/eejbyfeldt/scala_playground/bad_error_message.scala:6:20 
6 |  f(1 *: EmptyTuple)
  |                    ^
  |             Cannot prove that X =:= Tuple.Map[Tuple.InverseMap[X, F], F].
1 error found

Why this Error/Warning was not helpful

The message was unhelpful because it does not contain the actual types X and F where the compiler failed to prove type equality.

Suggested improvement

The message could be made more helpful by including the actual types for X and F where we failed to prove equality. E.g where X is Int *: EmptyTuple and F is TC

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions