1. 06 Jul, 2018 6 commits
    • Michael Sloan's avatar
      Add a broken test for lingering state from TH unique names #9693 · fbe162f5
      Michael Sloan authored
      The stderr output is
      
      ```
      Loading with T9693_initial.hs
      
      T9693_main.hs:4:1:
          Same exact name in multiple name-spaces:
            type constructor or class ‘X’, declared at: T9693_main.hs:4:1
            data constructor ‘X’, declared at: T9693_main.hs:4:1
            Probable cause: you bound a unique Template Haskell name (NameU),
            perhaps via newName, in different name-spaces.
            If that's it, then -ddump-splices might be useful
      Reloading with T9693_modified.hs
      
      T9693_main.hs:1:1:
          Data constructor ‘X’ used as a type constructor
      ```
      
      The strange thing is that the modified version uses (mkName "X"), which should
      be fine for simultaneous use in both a data constructor and type constructor.
      Indeed, on a fresh load, the modified version works fine. So there is some sort
      of state left over from the prior load when (newName "X") was used.
      
      Test Plan: testsuite/tests/th/T9693.script
      
      Reviewers: bgamari, sighingnow, RyanGlScott
      
      Reviewed By: sighingnow, RyanGlScott
      
      Subscribers: RyanGlScott, sighingnow, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4926
      fbe162f5
    • Krzysztof Gogolewski's avatar
      Mark AutoDeriveTypeable as deprecated · f59332f9
      Krzysztof Gogolewski authored
      Test Plan: validate
      
      Reviewers: bgamari, alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15342
      
      Differential Revision: https://phabricator.haskell.org/D4933
      f59332f9
    • Ben Gamari's avatar
      users guide: Mention -fprint-typechecker-elaboration in -ddump-tc docs · 87b28a83
      Ben Gamari authored
      Reviewers: mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4898
      87b28a83
    • Ben Gamari's avatar
      circleci: Detect core count · de95bf40
      Ben Gamari authored
      Test Plan: Try `./validate`, CircleCI build; make sure core count
      detection works in both cases.
      
      Reviewers: alpmestan
      
      Reviewed By: alpmestan
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14470
      
      Differential Revision: https://phabricator.haskell.org/D4897
      de95bf40
    • Krzysztof Gogolewski's avatar
      Remove BUILD_DPH, not used · 8c628ad9
      Krzysztof Gogolewski authored
      8c628ad9
    • Ryan Scott's avatar
      Make a variant of mkCastErr for kind coercions · 18cedbb5
      Ryan Scott authored
      Summary:
      I discovered when debugging #15346 that the Core Lint error
      message for ill typed casts always mentions types of enclosed
      //expressions//, even if the thing being casted is actually a type.
      This generalizes `mkCastErr` a bit to allow it to give the proper
      labelling for kind coercions.
      
      Test Plan: Run on failing program in #15346, read the Core Lint error
      
      Reviewers: goldfire, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4940
      18cedbb5
  2. 05 Jul, 2018 10 commits
    • Ryan Scott's avatar
      Accept new stdout for tcrun045 · 45f00268
      Ryan Scott authored
      The stdout produced by test tcrun045 changed in commit
      45f44e2c. The change appears to be
      benign, so I've decided to accept it.
      45f00268
    • Ryan Scott's avatar
      Comment out a pprTrace · 9b26aa09
      Ryan Scott authored
      This was introduced in commit
      45f44e2c, but it results in lots of
      "check_class ~" messages when validating. I've decided to just
      comment it out.
      9b26aa09
    • Ryan Scott's avatar
      Make ppr_tc_args aware of -fprint-explicit-kinds · dbdcacfc
      Ryan Scott authored
      Summary:
      `ppr_tc_args` was printing invisible kind arguments even
      when `-fprint-explicit-kinds` wasn't enabled. Easily fixed.
      
      Test Plan: make test TEST=T15341
      
      Reviewers: goldfire, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #15341
      
      Differential Revision: https://phabricator.haskell.org/D4932
      dbdcacfc
    • Ryan Scott's avatar
      Fix #15331 with careful blasts of parenthesizeHsType · b6a33861
      Ryan Scott authored
      Summary:
      Another `-ddump-splices` bug that can be solved with more
      judicious use of parentheses.
      
      Test Plan: make test TEST=T15331
      
      Reviewers: goldfire, bgamari, alanz, tdammers
      
      Reviewed By: tdammers
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15331
      
      Differential Revision: https://phabricator.haskell.org/D4920
      b6a33861
    • Ryan Scott's avatar
      Parenthesize rank-n contexts in Convert · 57733978
      Ryan Scott authored
      Summary: A simple oversight.
      
      Test Plan: make test TEST=T15324
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15324
      
      Differential Revision: https://phabricator.haskell.org/D4910
      57733978
    • Ryan Scott's avatar
      Fix newtype instance GADTs · 92751866
      Ryan Scott authored
      Summary: This was taken from Richard's branch, which in turn was
      submitted to Phab by Matthew, which in turn was commandeered by Ryan.
      
      This fixes an issue with newtype instances in which too many
      coercions were being applied in the worker. This fixes the issue by
      removing the data family instance axiom from the worker and moving
      to the wrapper. Moreover, we now require all newtype instances
      to have wrappers, for symmetry with data instances.
      
      Reviewers: goldfire, bgamari, simonpj, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #15318
      
      Differential Revision: https://phabricator.haskell.org/D4902
      92751866
    • Ryan Scott's avatar
      Instantiate GND bindings with an explicit type signature · 132273f3
      Ryan Scott authored
      Summary:
      Before, we were using visible type application to apply
      impredicative types to `coerce` in
      `GeneralizedNewtypeDeriving`-generated bindings. This approach breaks
      down when combined with `QuantifiedConstraints` in certain ways,
      which #14883 and #15290 provide examples of. See
      Note [GND and QuantifiedConstraints] for all the gory details.
      
      To avoid this issue, we instead use an explicit type signature to
      instantiate each GND binding, and use that to bind any type variables
      that might be bound by a class method's type signature. This reduces
      the need to impredicative type applications, and more importantly,
      makes the programs from #14883 and #15290 work again.
      
      Test Plan: make test TEST="T15290b T15290c T15290d T14883"
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14883, #15290
      
      Differential Revision: https://phabricator.haskell.org/D4895
      132273f3
    • Ryan Scott's avatar
      Fix #15308 by suppressing invisble args more rigorously · 93b7ac8d
      Ryan Scott authored
      Summary:
      There was a buglet in `stripInvisArgs` (which is part of the
      pretty-printing pipeline for types) in which only invisble arguments
      which came before any visible arguments would be suppressed, but any
      invisble arguments that came //after// visible ones would still be
      printed, even if `-fprint-explicit-kinds`  wasn't enabled.
      The fix is simple: make `stripInvisArgs` recursively process the
      remaining types even after a visible argument is encountered.
      
      Test Plan: make test TEST=T15308
      
      Reviewers: goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #15308
      
      Differential Revision: https://phabricator.haskell.org/D4891
      93b7ac8d
    • Ryan Scott's avatar
      Fix #15307 by making nlHsFunTy parenthesize more · 59a15a56
      Ryan Scott authored
      Summary:
      `nlHsFunTy` wasn't parenthesizing its arguments at all,
      which led to `-ddump-deriv` producing incorrectly parenthesized
      types (since it uses `nlHsFunTy` to construct those types), as
      demonstrated in #15307. Fix this by changing `nlHsFunTy` to add
      parentheses à la `ppr_ty`: always parenthesizing the argument type
      with function precedence, and recursively processing the result type,
      adding parentheses for each function type it encounters.
      
      Test Plan: make test TEST=T14578
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15307
      
      Differential Revision: https://phabricator.haskell.org/D4890
      59a15a56
    • Simon Peyton Jones's avatar
      Refactor validity checking for constraints · 45f44e2c
      Simon Peyton Jones authored
      There are several changes here.
      
      * TcInteract has gotten too big, so I moved all the class-instance
        matching out of TcInteract into a new module ClsInst. It parallels
        the FamInst module.
      
        The main export of ClsInst is matchGlobalInst.
        This now works in TcM not TcS.
      
      * A big reason to make matchGlobalInst work in TcM is that we can
        then use it from TcValidity.checkSimplifiableClassConstraint.
        That extends checkSimplifiableClassConstraint to work uniformly
        for built-in instances, which means that we now get a warning
        if we have givens (Typeable x, KnownNat n); see Trac #15322.
      
      * This change also made me refactor LookupInstResult, in particular
        by adding the InstanceWhat field.  I also changed the name of the
        type to ClsInstResult.
      
        Then instead of matchGlobalInst reporting a staging error (which is
        inappropriate for the call from TcValidity), we can do so in
        TcInteract.checkInstanceOK.
      
      * In TcValidity, we now check quantified constraints for termination.
        For example, this signature should be rejected:
           f :: (forall a. Eq (m a) => Eq (m a)) => blah
        as discussed in Trac #15316.   The main change here is that
        TcValidity.check_pred_help now uses classifyPredType, and has a
        case for ForAllPred which it didn't before.
      
        This had knock-on refactoring effects in TcValidity.
      45f44e2c
  3. 04 Jul, 2018 8 commits
  4. 01 Jul, 2018 1 commit
  5. 29 Jun, 2018 4 commits
  6. 28 Jun, 2018 2 commits
  7. 27 Jun, 2018 3 commits
  8. 26 Jun, 2018 6 commits