Skip to content

Warn about possible missing -XScopedTypeVariables on errors.

Suggest that the user they may wish to add -XScopedTypeVariables, if an error results from a free type variable which would be bound in its scope with the flag enabled. (i.e. if its name exists as a variable in the type declaration).

I ran into this problem on code similar to this:

instance (Sized a n, Nat n) => Rep a where
    emptyRep = replicate (toInt (undefined :: n)) 0

and it took me some time to solve, and only by having vague knowledge that such a flag existed.

Trac metadata
Trac field Value
Version 7.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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