[commit: ghc] ghc-8.0: Fix scoping of type variables in instances (e134a5b)

git at git.haskell.org git at git.haskell.org
Tue Sep 20 11:15:02 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/e134a5bcdd7ba383c49cd0033884d98f6ef92c0c/ghc

>---------------------------------------------------------------

commit e134a5bcdd7ba383c49cd0033884d98f6ef92c0c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Aug 26 17:32:42 2016 +0100

    Fix scoping of type variables in instances
    
    This fixes Trac #12531:
    
       class Foo x where
         foo :: forall a . x a -> x a
         default foo :: forall b . x b -> x b
         foo x = go
           where go :: x b
                 go = undefined
    
    We want 'b' to scope over the code for 'foo', but we were
    using 'a' instead.
    
    (cherry picked from commit 0050aff22ba04baca732bf5124002417ab667f8a)


>---------------------------------------------------------------

e134a5bcdd7ba383c49cd0033884d98f6ef92c0c
 compiler/hsSyn/HsUtils.hs                       | 29 +++++++++++++++++++-
 compiler/rename/RnBinds.hs                      | 30 +++++++++------------
 compiler/typecheck/TcClassDcl.hs                | 36 +++++++++++++++----------
 compiler/typecheck/TcInstDcls.hs                |  6 ++---
 testsuite/tests/rename/should_compile/T12533.hs | 10 +++++++
 testsuite/tests/rename/should_compile/all.T     |  1 +
 6 files changed, 77 insertions(+), 35 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e134a5bcdd7ba383c49cd0033884d98f6ef92c0c


More information about the ghc-commits mailing list