1. 18 Jan, 2016 5 commits
    • Simon Peyton Jones's avatar
      White space only · b7e5c302
      Simon Peyton Jones authored
      b7e5c302
    • Simon Peyton Jones's avatar
      Fix typecheck of default associated type decls · cb24e684
      Simon Peyton Jones authored
      This bug was thrown up by Trac #11361, but I found that the
      problem was deeper: GHC was allowing
      
        class C a where
          type F (a :: k) :: *
          type F (x :: *) = x    -- Not right!
      
      (Which is now indexed-types/should_compile/T11361a.)
      
      Anyway the fix is relatively simple; use tcMatchTys in
      tcDefaultAssocDecl.
      
      Merge to 8.0 branch.
      cb24e684
    • Simon Peyton Jones's avatar
      Layout only · f02200f1
      Simon Peyton Jones authored
      f02200f1
    • Simon Peyton Jones's avatar
      Simplify API to tcMatchTys · 5a62b6ac
      Simon Peyton Jones authored
      Previously tcMatchTys took a set of "template type variables" to
      bind.  But all the calls are top-level, and we always want to
      bind all variables in the template.  So I simplified the API
      by omitting that argument.
      
      There should be no change in behaviour.
      
      Feel free to merge to 8.0 if it helps in merging other patches
      5a62b6ac
    • Eric Seidel's avatar
      un-wire-in error, undefined, CallStack, and IP · a7b751db
      Eric Seidel authored
      I missed a crucial step in the wiring-in process of `CallStack` in D861,
      the bit where you actually wire-in the Name... This led to a nasty bug
      where GHC thought `CallStack` was not wired-in and tried to fingerprint
      it, which failed because the defining module was not loaded.
      
      But we don't need `CallStack` to be wired-in anymore since `error` and
      `undefined` no longer need to be wired-in. So we just remove them all.
      
      Updates haddock submodule.
      
      Test Plan: `./validate` and `make slowtest TEST=tc198`
      
      Reviewers: simonpj, goldfire, austin, hvr, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: goldfire, thomie
      
      Projects: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D1739
      
      GHC Trac Issues: #11331
      a7b751db
  2. 17 Jan, 2016 6 commits
  3. 16 Jan, 2016 4 commits
    • Simon Peyton Jones's avatar
      Add missing T11408.hs · 3b6a4909
      Simon Peyton Jones authored
      3b6a4909
    • Simon Peyton Jones's avatar
      Fix a number of subtle solver bugs · 9308c736
      Simon Peyton Jones authored
      As a result of some other unrelated changes I found that
      IndTypesPerf was failing, and opened Trac #11408.  There's
      a test in indexed-types/should-compile/T11408.
      
      The bug was that a type like
       forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int
      is in fact unambiguous, but it's a bit subtle to prove
      that it is unambiguous.
      
      In investigating, Dimitrios and I found several subtle
      bugs in the constraint solver, fixed by this patch
      
      * canRewrite was missing a Derived/Derived case.  This was
        lost by accident in Richard's big kind-equality patch.
      
      * Interact.interactTyVarEq would discard [D] a ~ ty if there
        was a [W] a ~ ty in the inert set.  But that is wrong because
        the former can rewrite things that the latter cannot.
        Fix: a new function eqCanDischarge
      
      * In TcSMonad.addInertEq, the process was outright wrong for
        a Given/Wanted in the (GWModel) case.  We were adding a new
        Derived without kicking out things that it could rewrite.
        Now the code is simpler (no special GWModel case), and works
        correctly.
      
      * The special case in kickOutRewritable for [W] fsk ~ ty,
        turns out not to be needed.  (We emit a [D] fsk ~ ty which
        will do the job.
      
      I improved comments and documentation, esp in TcSMonad.
      9308c736
    • Alan Zimmerman's avatar
      Work SourceText in for all integer literals · 3a1babd6
      Alan Zimmerman authored
      Summary:
      Certain syntactic elements have integers in them, such as fixity
      specifications, SPECIALISE pragmas and so on.
      
      The lexer will accept mult-radix literals, with arbitrary leading zeros
      in these.
      
      Bring in a SourceText field to each affected AST element to capture the
      original literal text for use with API Annotations.
      
      Affected hsSyn elements are
      
      ```
           -- See note [Pragma source text]
           data Activation = NeverActive
                           | AlwaysActive
                           | ActiveBefore SourceText PhaseNum
                                -- Active only *strictly before* this phase
                           | ActiveAfter SourceText PhaseNum
                                 -- Active in this phase and later
                           deriving( Eq, Data, Typeable )
                                     -- Eq used in comparing rules in HsDecls
      
           data Fixity = Fixity SourceText Int FixityDirection
             -- Note [Pragma source text]
             deriving (Data, Typeable)
       ```
      
      and
      
      ```
            | HsTickPragma         -- A pragma introduced tick
               SourceText           -- Note [Pragma source text] in BasicTypes
               (StringLiteral,(Int,Int),(Int,Int))
                                                -- external span for this tick
               ((SourceText,SourceText),(SourceText,SourceText))
                  -- Source text for the four integers used in the span.
                  -- See note [Pragma source text] in BasicTypes
               (LHsExpr id)
      ```
      
      Updates haddock submodule
      
      Test Plan: ./validate
      
      Reviewers: goldfire, bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1781
      
      GHC Trac Issues: #11430
      3a1babd6
    • Rik Steenkamp's avatar
      Fix some typos · 148a50b5
      Rik Steenkamp authored
      Differential Revision: https://phabricator.haskell.org/D1785
      148a50b5
  4. 15 Jan, 2016 22 commits
  5. 14 Jan, 2016 3 commits
    • Tamar Christina's avatar
      Remove lookup of sections by name instead use the index numbers as offsets · 49e414a7
      Tamar Christina authored
      Summary:
      This patch comes from @awson
      
      {{{
      Playing with `-fsplit-sections` on Windows I've found a pile of ancient
      (it was borrowed from Hugs interpreter code and I don't even know when
      was it created), absolutely redundant and plain wrong code in RTS linker.
      
      Technically it is a bug, but it doesn't break things when used with
      current Windows binutils with no special linker scripts involved.
      
      OTOH, it slows down runtime linker on Windows noticeably and thus can
      be considered as a performance bug.
      
      The nice side-effect for existing users is that GHCi now loads compiled
      object code much faster on Windows.
      }}}
      
      More specifically, sections were being looked up by name by doing a loop
      over all sections until the section with the given name is found.
      
      The new approach uses the section index and finds the section in O(1) time
      based on information gathered when we originally processed the section
      
      Test Plan: ./validate (was run on GHC x86)
      
      Reviewers: austin, awson, erikd, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Subscribers: awson, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D1773
      
      GHC Trac Issues: #11388
      49e414a7
    • Tamar Christina's avatar
      T11300: Fix test on windows · db371c10
      Tamar Christina authored
      Summary: Fix exit code for Windows to match expected for out-of-memory test
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, thomie, bgamari
      
      Reviewed By: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1753
      
      GHC Trac Issues: #11422
      db371c10
    • Alan Zimmerman's avatar
      API Annotations: use AnnValue for (~) · fd686c43
      Alan Zimmerman authored
      Previously oqtycon used AnnTilde for the location of the RdrName when
      parsing (~).
      
      The recent increase in '~' characters in the AST confuses
      ghc-exactprint, so this patch treats all RdrNames the same way now,
      marking the location of the core name with AnnValue.
      fd686c43