Skip to content

Give strong preference to type variable names in scope when reporting hole contexts

When using ScopedTypeVariables with typed holes, I want GHC to bend over backwards to preserve the names of type variables that the user has chosen to bring into scope. I can't immediately reproduce the situations I've run into recently where that hasn't happened, but sometimes I've had a signature like

foo :: forall bar . ...
foo = ... _ ...

and yet the typed hole message shows that bar has been lost in unification and replaced by some unrelated name. I would very much prefer if this never happened.

Trac metadata
Trac field Value
Version 7.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information