1. 06 Mar, 2017 1 commit
  2. 02 Mar, 2017 1 commit
    • David Feuer's avatar
      Prohibit RULES changing constructors · bc332b31
      David Feuer authored
      Previously, `RULES` like
      
      ```
      {-# RULES
      "JustNothing" forall x . Just x = Nothing
       #-}
      ```
      
      were allowed. Simon Peyton Jones say this seems to have been a
      mistake, that such rules have never been supported intentionally,
      and that he doesn't know if they can break in horrible ways.
      Furthermore, Ben Gamari and Reid Barton are considering trying to
      detect the presence of "static data" that the simplifier doesn't
      need to traverse at all. Such rules do not play well with that.
      So for now, we ban them altogether. In most cases, it's possible
      to work around the ban using hand-written wrapper functions.
      
      Reviewers: austin, simonpj, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3169
      bc332b31
  3. 08 Feb, 2017 1 commit
    • Matthew Pickering's avatar
      Fix push_bang_into_newtype when the pattern match has no arguments · 062f1123
      Matthew Pickering authored
      Correct behaviour of push_bang_into_newtype when the pattern match has
      no arguments. A user can write
      
      ```
      newtype T = T Int
      
      f :: T -> ()
      f !(T {}) = ()
      ```
      in which case we have to push the bang inwards through the newtype in
      order to achieve the desired strictness properties. This patch fixes
      this special case where the pattern match has no arguments to push the
      bang onto. We now make up a wildcard pattern which is wrapped in the
      bang pattern.
      
      ```
      f (T !_) = ()
      ```
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3057
      062f1123
  4. 22 Jan, 2017 1 commit
    • thomie's avatar
      Remove clean_cmd and extra_clean usage from .T files · 5d38fb69
      thomie authored
      The `clean_cmd` and `extra_clean` setup functions don't do anything.
      Remove them from .T files.
      
      Created using https://github.com/thomie/refactor-ghc-testsuite. This
      diff is a test for the .T-file parser/processor/pretty-printer in that
      repository.
      
          find . -name '*.T' -exec ~/refactor-ghc-testsuite/Main "{}" \;
      
      Tests containing inline comments or multiline strings are not modified.
      
      Preparation for #12223.
      
      Test Plan: Harbormaster
      
      Reviewers: austin, hvr, simonmar, mpickering, bgamari
      
      Reviewed By: mpickering
      
      Subscribers: mpickering
      
      Differential Revision: https://phabricator.haskell.org/D3000
      
      GHC Trac Issues: #12223
      5d38fb69
  5. 05 Jan, 2017 1 commit
    • Simon Peyton Jones's avatar
      Ensure nested binders have Internal Names · baf9ebe5
      Simon Peyton Jones authored
      This is a long-standing bug.  A nested (non-top-level) binder
      in Core should not have an External Name, like M.x. But
      
      - Lint was not checking this invariant
      
      - The desugarer could generate programs that failed the
        invariant.  An example is in
        tests/deSugar/should_compile/T13043, which had
           let !_ = M.scState in ...
        This desugared to
           let ds = case M.scSate of M.scState { DEFAULT -> () }
           in case ds of () -> ...
      
        We were wrongly re-using that scrutinee as a case binder.
        And Trac #13043 showed that could ultimately lead to two
        top-level bindings with the same closure name.  Alas!
      
      - The desugarer had one other place (in DsUtils.mkCoreAppDs)
        that could generate bogus code
      
      This patch fixes all three bugs, and adds a regression test.
      baf9ebe5
  6. 21 Dec, 2016 2 commits
    • Simon Peyton Jones's avatar
      Test Trac #12950 · c469db4e
      Simon Peyton Jones authored
      c469db4e
    • Simon Peyton Jones's avatar
      Fix 'SPECIALISE instance' · 1a4c04b1
      Simon Peyton Jones authored
      Trac #12944 showed that the DsBinds code that implemented a
      SPECIALISE pragma was inadequate if the constraints solving
      added let-bindings for dictionaries.  The result was that
      we ended up with an unbound dictionary in a DFunUnfolding -- and
      Lint didn't even check for that!
      
      Fixing this was not entirely straightforward
      
      * In DsBinds.dsSpec we use a new function
           TcEvidence.collectHsWrapBinders
        to pick off the lambda binders from the HsWapper
      
      * dsWrapper now returns a (CoreExpr -> CoreExpr) function
      
      * CoreUnfold.specUnfolding now takes a (CoreExpr -> CoreExpr)
        function it can use to specialise the unfolding.
      
      On the whole the code is simpler than before.
      1a4c04b1
  7. 20 Jun, 2016 1 commit
  8. 12 Feb, 2016 1 commit
    • Simon Peyton Jones's avatar
      Simplify AbsBinds wrapping · c6485d5e
      Simon Peyton Jones authored
      In poking Trac #11414 I found myself sinking into the abe_inst_wrap
      swamp.  What is this strange thing?  (It turned out that #11414 was
      breaking because of it.)
      
      Thrillingly, I found a way to sweep it away again, putting the deep
      instantation into tcMonoBinds instead of mkExport; and it turned out
      that the fun_co_fn field of FunBind was already there ready to receive
      exactly this wrapper. Hooray.  Result
      
      * Death to abe_inst_wrap
      * Death to mbi_orig
      * Death to the plumbing in tcPolyInfer that did the
        deep instantiation
      
      I did find that I had to re-engineer the treatment of instance type
      signatures (again), but the result looks more modular and robust to
      me.
      
      And #11414 is fixed.
      c6485d5e
  9. 17 Jan, 2016 1 commit
  10. 17 Dec, 2015 1 commit
  11. 03 Dec, 2015 1 commit
    • Georgios Karachalias's avatar
      Major Overhaul of Pattern Match Checking (Fixes #595) · 8a506104
      Georgios Karachalias authored
      This patch adresses several problems concerned with exhaustiveness and
      redundancy checking of pattern matching. The list of improvements includes:
      
      * Making the check type-aware (handles GADTs, Type Families, DataKinds, etc.).
        This fixes #4139, #3927, #8970 and other related tickets.
      
      * Making the check laziness-aware. Cases that are overlapped but affect
        evaluation are issued now with "Patterns have inaccessible right hand side".
        Additionally, "Patterns are overlapped" is now replaced by "Patterns are
        redundant".
      
      * Improved messages for literals. This addresses tickets #5724, #2204, etc.
      
      * Improved reasoning concerning cases where simple and overloaded
        patterns are matched (See #322).
      
      * Substantially improved reasoning for pattern guards. Addresses #3078.
      
      * OverloadedLists extension does not break exhaustiveness checking anymore
        (addresses #9951). Note that in general this cannot be handled but if we know
        that an argument has type '[a]', we treat it as a list since, the instance of
        'IsList' gives the identity for both 'fromList' and 'toList'. If the type is
        not clear or is not the list type, then the check cannot do much still. I am
        a bit concerned about OverlappingInstances though, since one may override the
        '[a]' instance with e.g. an '[Int]' instance that is not the identity.
      
      * Improved reasoning for nested pattern matching (partial solution). Now we
        propagate type and (some) term constraints deeper when checking, so we can
        detect more inconsistencies. For example, this is needed for #4139.
      
      I am still not satisfied with several things but I would like to address at
      least the following before the next release:
          Term constraints are too many and not printed for non-exhaustive matches
      (with the exception of literals). This sometimes results in two identical (in
      appearance) uncovered warnings. Unless we actually show their difference, I
      would like to have a single warning.
      8a506104
  12. 14 Nov, 2015 1 commit
  13. 24 Sep, 2015 1 commit
  14. 13 Jul, 2015 1 commit
  15. 09 Jun, 2015 1 commit
  16. 07 Apr, 2015 1 commit
  17. 21 Oct, 2014 1 commit
    • mlen's avatar
      Enabled warn on tabs by default (fixes #9230) · 972ba121
      mlen authored
      Summary:
      This revision enables -fwarn-tabs by default and add a suppression
      flag, so that GHC compilation won't fail when some files contain tab
      characters.
      
      Test Plan: Additional test case, T9230, was added to cover that change.
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: simonmar, ezyang, carter, thomie, mlen
      
      Differential Revision: https://phabricator.haskell.org/D255
      
      GHC Trac Issues: #9230
      
      Conflicts:
      	testsuite/driver/testlib.py
      972ba121
  18. 23 Oct, 2013 1 commit
  19. 13 Feb, 2013 1 commit
  20. 11 Feb, 2013 2 commits
  21. 07 Feb, 2013 1 commit
    • ian@well-typed.com's avatar
      Pass the test name to the test options · effc8af9
      ian@well-typed.com authored
      This allows them to give framework failures.
      
      I also had to change how setTestOpts works. Now, rather than applying
      the options to the directory's "default options", it just stores the
      options to be applied for each test (i.e. once we know the test name).
      effc8af9
  22. 04 Jan, 2013 1 commit
  23. 18 Sep, 2012 1 commit
  24. 30 Nov, 2011 1 commit
  25. 05 Sep, 2011 1 commit
  26. 20 Jul, 2011 1 commit
  27. 11 Jun, 2011 1 commit
  28. 04 May, 2011 1 commit
  29. 02 Apr, 2011 1 commit
  30. 21 Jan, 2011 1 commit
  31. 05 Jan, 2011 1 commit
  32. 20 Nov, 2010 1 commit
  33. 16 Nov, 2010 1 commit
  34. 26 Oct, 2010 1 commit
  35. 06 Oct, 2010 2 commits
  36. 10 Aug, 2009 1 commit
  37. 07 Aug, 2009 1 commit