Skip to content

Show real type names in error messages #4355

Open
@Blaisorblade

Description

@Blaisorblade

In #4323 I was concerned about writing incorrect names for types in error messages.

Writing Expr' in the error seems a (separate?) bug:

15 |     case (IExpr(i1), IExpr(i2)) => IExpr(i1 + i2)
   |                                    ^^^^^^^^^^^^^^
   |                                    found:    Expr.IExpr
   |                                    required: Expr'[T]
   |                                    
   |                                    where:    Expr  is a object
   |                                              Expr' is a trait

because it's false that "Expr' is a trait". A bit better would be:

   |                                    where:    Expr  refers to object Expr
   |                                              Expr' refers to trait Expr

But even better would be to have a clearer syntax for these "footnotes", something where the annotation is more clearly separate from the Scala syntax. For instance, if we use @ (which is reserved and can't be used in types, I think):

   |                                    where:    Expr@1  refers to object Expr
   |                                              Expr@2 refers to trait Expr

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions