Skip to content

Type synonyms in error messages #1821

Description

@user471
type Foo = {foo::Int}

bar :: Foo -> _
bar x = x + 1

Is it possible to use Foo instead of { foo :: Int} in error message?
It's much harder to understand the error especially with big records.

Could not match type

     { foo :: Int
     }

   with type

     Int


 while trying to match type { foo :: Int
                            }
   with type Int
 while checking that type { foo :: Int
                          }
   is at least as general as type Int
 while checking that type Int
   is at least as general as type { foo :: Int
                                  }
 while checking that expression 1
   has type { foo :: Int
            }
 while applying a function ((+) (#dict Semiring _1)) x
   of type _1 -> _1
   to argument 1
 while inferring the type of ((+) x) 1
 while checking that expression ((+) x) 1
   has type _0
 while checking that expression \x ->
                                  ((+) x) 1
   has type { foo :: Int
            }
            -> _0
 in value declaration bar

 where _0 is an unknown type
       _1 is an unknown type

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions