diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-06-16 22:16:14 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-06-16 22:20:25 +0100 |
commit | dc8e6861dc5586a8222484afc3bd26c432e2d69c (patch) | |
tree | 1c4d17068cd6869bca40d99c78dc1a16a4e678de /driver/gcc | |
parent | 9849403147b584ff160daeb4f13bf36adb2bab2e (diff) | |
download | haskell-dc8e6861dc5586a8222484afc3bd26c432e2d69c.tar.gz |
Fix the treatment of 'closed' definitions
The IdBindingInfo field of ATcId serves two purposes
- to control generalisation when we have -XMonoLocalBinds
- to check for floatability when dealing with (static e)
These are related, but not the same, and they'd becomme confused.
Trac #13804 showed this up via an example like this:
f periph = let sr :: forall a. [a] -> [a]
sr = if periph then reverse else id
sr2 = sr
-- The question: is sr2 generalised?
-- It should be, because sr has a type sig
-- even though it has periph free
in
(sr2 [True], sr2 "c")
Here sr2 should be generalised, despite the free var 'periph'
in 'sr' because 'sr' has a closed type signature.
I documented all this very carefully this time, in TcRnTypes:
Note [Meaning of IdBindingInfo]
Note [Bindings with closed types: ClosedTypeId]
Diffstat (limited to 'driver/gcc')
0 files changed, 0 insertions, 0 deletions