[commit: ghc] master: Fix an obscure but terrible bug in the simplifier (Trac #9567) (b8392ae)

git at git.haskell.org git at git.haskell.org
Thu Dec 11 17:12:07 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b8392ae76a6d39c57be94b5ba041c450ab479e2b/ghc

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

commit b8392ae76a6d39c57be94b5ba041c450ab479e2b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Dec 11 17:12:49 2014 +0000

    Fix an obscure but terrible bug in the simplifier (Trac #9567)
    
    The issue was that contInputType simply gave the wrong answer
    for type applications.
    
    There was no way to fix contInputType; it just didn't have enough
    information.  So I did this:
    
    * Split the ApplyTo constructor of SimplUtils.SimplCont into
          ApplyToVal
          ApplyToTy
      I used record syntax for them; we should do this for some
      of the other constructors too.
    
    * The latter carries a sc_hole_ty, which is the type of the
      continuation's "hole"
    
    * Maintaining this type meant that I had do to something
      similar for SimplUtils.ArgSpec.
    
    * I renamed contInputType to contHoleType for consistency.
    
    * I did a bit of refactoring around the call to tryRules
      in Simplify, which was jolly confusing before.
    
    The resulting code is quite nice now.  And it has the additional
    merit that it works.
    
    The tests are simply tc124 and T7891 with -O enabled.


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

b8392ae76a6d39c57be94b5ba041c450ab479e2b
 compiler/simplCore/SimplUtils.hs                  | 337 +++++++++++++---------
 compiler/simplCore/Simplify.hs                    | 140 +++++----
 testsuite/tests/typecheck/should_compile/T7891.hs |   2 +
 testsuite/tests/typecheck/should_compile/tc124.hs |   2 +
 4 files changed, 292 insertions(+), 189 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 b8392ae76a6d39c57be94b5ba041c450ab479e2b


More information about the ghc-commits mailing list