[commit: ghc] master: Fix treatment of hi-boot files and dfuns (a57d5c4)

git at git.haskell.org git at git.haskell.org
Fri Dec 21 16:55:20 UTC 2018


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

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

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

commit a57d5c4d3e39ab9ac2c31431b5e38818359fa5b5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Dec 20 17:49:34 2018 +0000

    Fix treatment of hi-boot files and dfuns
    
    Trac #16038 exposed the fact that TcRnDriver.checkHiBootIface
    was creating a binding, in the module being compiled, for
       $fxBlah = $fBlah
    
     but $fxBlah was a /GlobalId/. But all bindings should be for
     /LocalIds/ else dependency analysis goes down the tubes.
    
    * I added a CoreLint check that an occurrence of a GlobalId
      is not bound by an binding of a LocalId.  (There is already
      a binding-site check that no binding binds a GlobalId.)
    
    * I refactored (and actually signficantly simplified) the
      tricky code for dfuns in checkHiBootIface to ensure that
      we get LocalIds for those boot-dfuns.
    
    Alas, I then got "duplicate instance" messages when compiling
    HsExpr. It turns out that this is a long-standing, but extremely
    delicate, bug: even before this patch, if you compile HsExpr
    with -ddump-tc-trace, you get "duplicate instance". Without
    -ddump-tc-trace, it's OK.  What a mess!
    
    The reason for the duplicate-instance is now explained in
    Note [Loading your own hi-boot file] in LoadIface.  I fixed
    it by a Gross Hack in LoadIface.loadInterface. This is at
    least no worse than before.
    
    But there should be a better way. I have opened #16081 for this.


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

a57d5c4d3e39ab9ac2c31431b5e38818359fa5b5
 compiler/coreSyn/CoreLint.hs                |  61 ++++----
 compiler/iface/LoadIface.hs                 |  93 ++++++++----
 compiler/typecheck/FamInst.hs               |  78 +++++-----
 compiler/typecheck/TcRnDriver.hs            | 215 +++++++++++++++-------------
 testsuite/tests/driver/T14075/T14075.stderr |   8 +-
 5 files changed, 257 insertions(+), 198 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 a57d5c4d3e39ab9ac2c31431b5e38818359fa5b5


More information about the ghc-commits mailing list