1. 15 Jan, 2019 1 commit
  2. 21 Dec, 2018 1 commit
    • Ryan Scott's avatar
      Fix #16002 by moving a validity check to the renamer · 28f41f1a
      Ryan Scott authored
      Summary:
      The validity check which rejected things like:
      
      ```lang=haskell
      type family B x where
        A x = x
      ```
      
      Used to live in the typechecker. But it turns out that this validity
      check was //only// being run on closed type families without CUSKs!
      This meant that GHC would silently accept something like this:
      
      ```lang=haskell
      type family B (x :: *) :: * where
        A x = x
      ```
      
      This patch fixes the issue by moving this validity check to the
      renamer, where we can be sure that the check will //always// be run.
      
      Test Plan: make test TEST=T16002
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: goldfire, rwbarton, carter
      
      GHC Trac Issues: #16002
      
      Differential Revision: https://phabricator.haskell.org/D5420
      28f41f1a
  3. 11 Dec, 2018 1 commit
    • Roland Senn's avatar
      Misleading msg with qualified imports "No module named X imported" · 4c174ddd
      Roland Senn authored
      To check whether a given module has been imported, we do the following:
      From the list of all qualified names we extract the distinct module
      names to a list of module names.
      Then we check whether the given module name is in this list of module
      names.
      
      Test Plan: make test TEST=T14225
      
      Reviewers: mpickering, hvr, monoidal, osa1, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14225
      
      Differential Revision: https://phabricator.haskell.org/D5331
      4c174ddd
  4. 29 Nov, 2018 1 commit
    • mayac's avatar
      Fix #15828, from `More explicit foralls` · fe57a5ba
      mayac authored
      Summary:
      Fix a bug in commit 12eeb9 which permits the following:
      
      ```
      class C a where
        type T a b
      instance C (Maybe a) where
        type forall a b. T (Maybe a) b = b
      ```
      
      where instead, the user should write:
      
      ```
      instance C (Maybe a) where
        type forall b. T (Maybe a) b = b
      ```
      
      Update the users guide to discuss scoping of type variables in
      explicit foralls in type family instances.
      
      Test Plan: validate
      
      Reviewers: bgamari, goldfire, monoidal
      
      Reviewed By: goldfire
      
      Subscribers: monoidal, rwbarton, carter
      
      GHC Trac Issues: #15828
      
      Differential Revision: https://phabricator.haskell.org/D5283
      fe57a5ba
  5. 04 Nov, 2018 1 commit
    • Roland Senn's avatar
      Fix for Trac #15611: Scope errors lie about what modules are imported. · 1a3b9bd0
      Roland Senn authored
      Summary:
      For the error message:
          Not in scope X.Y
          Module X does not export Y
          No module named ‘X’ is imported:
      there are 2 cases, where we don't show the last "no module named is imported" line:
      1. If the module X has been imported.
      2. If the module X is the current module. There are 2 subcases:
      
         2.1 If the unknown module name is in a input source file,
             then we can use the getModule function to get the current module name.
      
         2.2 If the unknown module name has been entered by the user in GHCi,
             then the getModule function returns something like "interactive:Ghci1",
             and we have to check the current module in the last added entry of
             the HomePackageTable.
      
      Test Plan: make test TESTS="T15611a T15611b"
      
      Reviewers: monoidal, hvr, thomie, dfeuer, bgamari, DavidEichmann
      
      Reviewed By: monoidal, DavidEichmann
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15611
      
      Differential Revision: https://phabricator.haskell.org/D5284
      1a3b9bd0
  6. 27 Oct, 2018 1 commit
    • mayac's avatar
      More explicit foralls (GHC Proposal 0007) · 512eeb9b
      mayac authored
      Allow the user to explicitly bind type/kind variables in type and data
      family instances (including associated instances), closed type family
      equations, and RULES pragmas. Follows the specification of GHC
      Proposal 0007, also fixes #2600. Advised by Richard Eisenberg.
      
      This modifies the Template Haskell AST -- old code may break!
      
      Other Changes:
      - convert HsRule to a record
      - make rnHsSigWcType more general
      - add repMaybe to DsMeta
      
      Includes submodule update for Haddock.
      
      Test Plan: validate
      
      Reviewers: goldfire, bgamari, alanz
      
      Subscribers: simonpj, RyanGlScott, goldfire, rwbarton,
                   thomie, mpickering, carter
      
      GHC Trac Issues: #2600, #14268
      
      Differential Revision: https://phabricator.haskell.org/D4894
      512eeb9b
  7. 25 Sep, 2018 1 commit
  8. 23 Sep, 2018 2 commits
  9. 21 Aug, 2018 1 commit
    • Simon Peyton Jones's avatar
      Improve ambiguous-occurrence error message · 18c302cb
      Simon Peyton Jones authored
      Trac #15487 correctly reported that the qualification
      of a Name in an ambiguous-occurrence error message was
      wrong.  This patch fixes it.
      
      It's easily done, in RnUtils.addNameClashErrRn
      
      The problem was that in complaining about M.x we must
      enusre that 'M' part is the same as that used in
      pprNameProvenance.
      18c302cb
  10. 20 Aug, 2018 1 commit
    • Simon Peyton Jones's avatar
      Initialise cec_suppress properly · ecc0ddf6
      Simon Peyton Jones authored
      In TcErrors, cec_suppress is used to suppress low-priority
      errors in favour of truly insoluble ones.
      
      But I was failing to initialise it correcly at top level, which
      resulted in Trac #15539.  Easy to fix.
      
      A few regression tests have fewer errors reported, but that seems to
      be an improvement.
      ecc0ddf6
  11. 17 Aug, 2018 1 commit
  12. 03 Jun, 2018 1 commit
  13. 18 Dec, 2017 1 commit
  14. 05 Oct, 2017 1 commit
  15. 03 Oct, 2017 1 commit
    • Simon Peyton Jones's avatar
      Suppress error cascade in record fields · cb767542
      Simon Peyton Jones authored
      When a record contruction or pattern uses a data constructor
      that isn't in scope, we may produce spurious ambiguous-field
      errors (Trac #14307).  E.g.
      
         f (A { fld = x }) = e
      
      where 'A' is not in scope.  We want to draw attention to the
      out-of-scope data constructor first; once that is fixed we
      can think about the fields.
      
      This patch suppresses the field errors if the data con is out
      of scope.
      cb767542
  16. 21 Sep, 2017 1 commit
  17. 11 Jul, 2017 1 commit
  18. 11 May, 2017 1 commit
    • mrkgnao's avatar
      Fix incorrect ambiguity error on identically-named data constructors · 1381c142
      mrkgnao authored
      Given multiple in-scope constructors with the same name, say `A`, and a
      function of type `A -> Int`, say, the compiler reports both a "type `A`
      is not in scope" and (incorrectly) an ambiguity error. The latter
      shouldn't be there if `DataKinds` isn't enabled.
      
      This issue was recommended to me by @mpickering as a suitable first
      task, and the fix was also outlined in the original Trac ticket. It
      involved a simple reordering of the steps taken in `lookup_demoted` in
      `RnEnv.hs`. The fix is to make the `DataKinds` check happen earlier,
      ensuring that the ambiguity check doesn't happen at all if we know the
      constructors couldn't have been promoted.
      Signed-off-by: mrkgnao's avatarSoham Chowdhury <chow.soham@gmail.com>
      
      Reviewers: mpickering, austin, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #13568
      
      Differential Revision: https://phabricator.haskell.org/D3547
      1381c142
  19. 08 May, 2017 1 commit
  20. 26 Feb, 2017 1 commit
    • rwbarton's avatar
      tests: remove extra_files.py (#12223) · 3415bcaa
      rwbarton authored
      The script I used is included as testsuite/driver/kill_extra_files.py,
      though at this point it is for mostly historical interest.
      
      Some of the tests in libraries/hpc relied on extra_files.py, so this
      commit includes an update to that submodule.
      
      One test in libraries/process also relies on extra_files.py, but we
      cannot update that submodule so easily, so for now we special-case it
      in the test driver.
      3415bcaa
  21. 22 Jan, 2017 1 commit
  22. 10 Jan, 2017 1 commit
  23. 02 Jan, 2017 1 commit
  24. 25 Nov, 2016 1 commit
  25. 17 Oct, 2016 1 commit
  26. 12 Oct, 2016 1 commit
    • Ben Gamari's avatar
      RnExpr: Actually fail if patterns found in expression · bce99086
      Ben Gamari authored
      This fixes #12584, where wildcard patterns were snuck into an
      expression, which then crashed the typechecker in TcExpr since EWildPats
      aren't supposed to appear in the AST after renaming.
      
      The problem was that `rnTopSpliceDecl` failed to check for errors from
      `rnSplice` (as done by other callers to `rnSplice`).
      
      Thanks to Shayan for reporting this!
      
      Reviewers: simonpj, austin
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2539
      
      GHC Trac Issues: #12584
      bce99086
  27. 24 Jun, 2016 1 commit
  28. 09 Jun, 2016 1 commit
    • Facundo Domínguez's avatar
      Improve the error messages for static forms. · e9dfb6e5
      Facundo Domínguez authored
      Now the message explains why closed variables are not closed when
      encountered in the body of (static ...).
      
      This required adding to the local environment the free variables of
      the local bindings in scope. Thus we can analyze and explain why a
      variable is not closed when encountered.
      
      Test Plan: ./validate
      
      Reviewers: austin, simonpj, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: mboes, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2167
      
      GHC Trac Issues: #12003
      e9dfb6e5
  29. 28 Apr, 2016 1 commit
  30. 29 Mar, 2016 1 commit
  31. 17 Feb, 2016 1 commit
  32. 18 Nov, 2015 1 commit
    • Joachim Breitner's avatar
      More import related hints · 11e336e4
      Joachim Breitner authored
      Now for unqualified imports. Improves upon #11071.
      
      Unfortunately, it seems that since 7.10, ghc will not print all
      out-of-scope errors.
      
      Test Plan: test suite updated
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1478
      
      GHC Trac Issues: #11071
      11e336e4
  33. 13 Nov, 2015 1 commit
  34. 17 Sep, 2015 1 commit
  35. 03 Sep, 2015 1 commit
  36. 30 Jul, 2015 2 commits
  37. 23 Jul, 2015 1 commit
    • thomasw's avatar
      Parenthesise TypeOperator in import hints · b5c94262
      thomasw authored
      When a constructor was mistakenly imported directly instead of as a
      constructor of a data type, a hint will be shown on how to correctly
      import
      it. Just like the constructor, the data type should be surrounded in
      parentheses if it is an operator (TypeOperator in this case).
      
      Instead of:
      
          error:
              In module ‘Data.Type.Equality’:
                ‘Refl’ is a data constructor of ‘:~:’
              To import it use
                ‘import’ Data.Type.Equality( :~:( Refl ) )
              or
                ‘import’ Data.Type.Equality( :~:(..) )
      
      Print:
      
          error:
              In module ‘Data.Type.Equality’:
                ‘Refl’ is a data constructor of ‘(:~:)’
              To import it use
                ‘import’ Data.Type.Equality( (:~:)( Refl ) )
              or
                ‘import’ Data.Type.Equality( (:~:)(..) )
      
      Test Plan: pass new test
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1093
      
      GHC Trac Issues: #10668
      b5c94262
  38. 08 Jul, 2015 1 commit