1. 19 Apr, 2018 1 commit
    • Ryan Scott's avatar
      Fix #15012 with a well-placed use of Any · b08a6d75
      Ryan Scott authored
      Previously, derived `Generic1` instances could have associated `Rep1`
      type family instances with unbound variables, such as in the following
      example:
      
      ```lang=haskell
      data T a = MkT (FakeOut a) deriving Generic1
      type FakeOut a = Int
      
      ==>
      
      instance Generic1 T where
        type Rep1 T = ... (Rec0 (FakeOut a))
      ```
      
      Yikes! To avoid this, we simply map the last type variable in a
      derived `Generic1` instance to `Any`.
      
      Test Plan: make test TEST=T15012
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: simonpj, thomie, carter
      
      GHC Trac Issues: #15012
      
      Differential Revision: https://phabricator.haskell.org/D4602
      b08a6d75
  2. 26 Feb, 2017 1 commit
  3. 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
  4. 24 Jun, 2016 1 commit
    • Simon Peyton Jones's avatar
      Improve typechecking of instance defaults · d2958bd0
      Simon Peyton Jones authored
      In an instance declaration when you don't specify the code for a
      method, GHC fills in from the default binding in the class.
      The type of the default method can legitmiately be ambiguous ---
      see Note [Default methods in instances] in TcInstDcls --- so
      typechecking it can be tricky.
      
      Trac #12220 showed that although we were dealing with that ambiguity
      for /vanilla/ default methods, we were not doing so for /generic/
      default methods.  Moreover we were dealing with it clumsily, by
      generating post-typechecked code.
      
      This patch fixes the bug AND deletes code!  We now use the same code
      path for both vanilla and generic default methods; and generate
      /pre-typechecked/ code in both cases.  The key trick is that we can use
      Visible Type Application to deal with the ambiguity, which wasn't
      possible before.  Hooray.
      
      There is a small hit to performance in compiler/perf/T1969 which
      consists of nothing BUT instance declarations with several default
      methods to fill, which we now h...
      d2958bd0
  5. 06 Jan, 2016 1 commit
    • Ryan Scott's avatar
      Restore old GHC generics behavior vis-à-vis Fixity · 852b6030
      Ryan Scott authored
      Phab:D493 accidentally changed the way GHC generics looks up `Fixity`
      information when deriving `Generic` or `Generic1`. Before, a `Fixity` of
      `Infix` would be given only if a data constructor was declared infix,
      but now, `Infix` is given to any data constructor that has a fixity
      declaration (not to be confused with being declared infix!). This commit
      reverts back to the original behavior for consistency's sake.
      
      Fixes #11358.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1740
      
      GHC Trac Issues: #11358
      852b6030
  6. 21 Dec, 2015 1 commit
    • Ryan Scott's avatar
      Encode strictness in GHC generics metadata · ee6fba89
      Ryan Scott authored
      This augments `MetaSel` with a `Bang` field, which gives generic
      programmers access to the following information about each field
      selector:
      
      * `SourceUnpackedness`: whether a field was marked `{-# NOUNPACK #-}`,
        `{-# UNPACK #-}`, or not
      * `SourceStrictness`: whether a field was given a strictness (`!`) or
        laziness (`~`) annotation
      * `DecidedStrictness`: what strictness GHC infers for a field during
        compilation, which may be influenced by optimization levels,
        `-XStrictData`, `-funbox-strict-fields`, etc.
      
      Unlike in Phab:D1603, generics does not grant a programmer the ability
      to "splice" in metadata, so there is no issue including
      `DecidedStrictness` with `Bang` (whereas in Template Haskell, it had to
      be split off).
      
      One consequence of this is that `MetaNoSel` had to be removed, since it
      became redundant. The `NoSelector` empty data type was also removed for
      similar reasons.
      
      Fixes #10716.
      
      Test Plan: ./validate
      
      Reviewers: dreixel, goldfire, kosmikus, aust...
      ee6fba89
  7. 03 Oct, 2015 1 commit
    • Ryan Scott's avatar
      Fill in associated type defaults with DeriveAnyClass · 2f74be9c
      Ryan Scott authored
      Summary:
      Unlike `-XDefaultSignatures`, `-XDeriveAnyClass` would not fill in
      associated type family defaults when deriving a class which contained
      them.
      
      In order to fix this properly, `tcATDefault` needed to be used from
      `TcGenDeriv`. To avoid a module import cycle, `tcATDefault` was moved
      from `TcInstDcls` to `TcClsDcl`.
      
      Fixes #10361.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, bgamari, austin, simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1283
      
      GHC Trac Issues: #10361
      2f74be9c
  8. 13 Jul, 2015 1 commit
  9. 04 Jun, 2015 1 commit
    • thomie's avatar
      Testsuite: add/fix cleanup for certain tests · e340f6ec
      thomie authored
      * extra_clean argument should be a list
        Add an assert to prevent regressions.
      
      * properly clean package conf direcories
        They are directories now, which was causing problems.
      
      * properly clean write_interface_* tests
        We were getting these errors:
      
        [Errno 21] Is a directory: './driver/write_interface_oneshot'
        [Errno 39] Directory not empty: './driver/write_interface_oneshot'
        [Errno 21] Is a directory: './driver/write_interface_make'
        [Errno 39] Directory not empty: './driver/write_interface_make'
      
      * outputdir() is better than -outputdir, as it knows how to (pre)clean
        itself.
      e340f6ec
  10. 03 Apr, 2015 1 commit
  11. 05 Feb, 2015 1 commit
  12. 23 Dec, 2014 1 commit
    • Simon Peyton Jones's avatar
      Attempt to improve cleaning · c3394e0d
      Simon Peyton Jones authored
      I found several tests that failed when the interface file format changed,
      due to leftover .hi file droppings.
      
      I'm not sure I've done this right, but it should be a bit better
      c3394e0d
  13. 02 Dec, 2014 1 commit
  14. 21 Nov, 2014 1 commit
  15. 12 Sep, 2014 1 commit
  16. 18 Nov, 2013 1 commit
  17. 09 May, 2013 1 commit
  18. 13 Feb, 2013 1 commit
  19. 21 Jun, 2012 1 commit
  20. 26 Apr, 2012 1 commit
  21. 25 Nov, 2011 2 commits
  22. 16 Nov, 2011 1 commit
  23. 07 Oct, 2011 1 commit
  24. 20 Jul, 2011 1 commit
  25. 05 Jul, 2011 1 commit
  26. 09 May, 2011 1 commit
  27. 04 May, 2011 1 commit
  28. 02 May, 2011 3 commits