[GHC] #14759: ListSetOps WARNING causes tests to fail

GHC ghc-devs at haskell.org
Thu Apr 26 10:18:49 UTC 2018


#14759: ListSetOps WARNING causes tests to fail
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4628
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * cc: niteria (added)


Comment:

 OK, so the culprit is the `unionLists` for the `imp_finsts` field of
 `ImportAvails`.

 Obvious ideas:

 1.  Represent `imp_finsts` as a `ModuleSet`
 2.  Represent `imp_finsts` as a `Bag Module` (ie with duplicates)

 There's a helpful `Note [Combine ImportAvails]` in `RnNames` which
 explains why a set is a bit awkward.

 My instinct is to try a `Bag` (so that `plusAvails` can use `unionBags`
 which is always fast), and move the removing-duplicates work to the
 consumer.

 I think there are two consumers of `imp_finsts`:

 * `tcExtendLocalFamInstEnv` loads up dependent modules.  So we'd need
 eliminate duplicates, but determinacy is not an issue
 * `DsUsage.mkDependencies` which already does a sort, so removing dups at
 the same time should surely not be hard.

 Bartosz is the expert here.  cc'd.

 * `

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


More information about the ghc-tickets mailing list