Skip to content

Introduce new type variables where necessary when applying wildcard suggestions #2640

@hdgarrood

Description

@hdgarrood

Split off from #2638. If I write the following in a source file and get a suggestion from the compiler on how to fix the warning:

myConst :: forall a. a -> _ -> a
myConst = const

then applying the suggestion doesn't actually change the type signature. I was expecting the declaration to be changed to this:

myConst :: forall a b. a -> b -> a
myConst = const

so that the result compiles without warnings. It doesn't really matter what the new type variable is called IMO, it doesn't absolutely have to be b; t0 or similar would be fine too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions