[GHC] #12533: Internal error using redundant forall with default signature

GHC ghc-devs at haskell.org
Fri Aug 26 16:42:00 UTC 2016


#12533: Internal error using redundant forall with default signature
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Compile-time      |            Test Case:
  crash                              |  rename/should_compile/T12533
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I put the wrong ticket number in the commit message. The full commit is
 {{{
 commit 0050aff22ba04baca732bf5124002417ab667f8a
 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.

  compiler/hsSyn/HsUtils.hs                       | 29
 ++++++++++++++++++++++++++++-
  compiler/rename/RnBinds.hs                      | 31
 ++++++++++++++-----------------
  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, 78 insertions(+), 35 deletions(-)
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12533#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list