1. 21 Jan, 2016 1 commit
  2. 20 Jan, 2016 7 commits
    • niteria's avatar
      substTy to substTyUnchecked to fix Travis build · 48d4bc53
      niteria authored
      This fixes the immediate problem from
      https://s3.amazonaws.com/archive.travis-ci.org/jobs/103319396/log.txt
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1802
      
      GHC Trac Issues: #11371
      48d4bc53
    • thomie's avatar
      Update submodule stm + random · 6ddc9911
      thomie authored
      Skip random tests when random is not built.
      Skip stm tests when stm is not built.
      6ddc9911
    • Rik Steenkamp's avatar
      Add test T9407 (Windows) · 225afc4a
      Rik Steenkamp authored
      Add test for #9407. The test is only run on Windows 64bit, as this is
      where the problem occurred.
      
      Reviewed by: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1806
      225afc4a
    • Ben Gamari's avatar
      Rework derivation of type representations for wired-in things · 84b0ebed
      Ben Gamari authored
      Previously types defined by `GHC.Types` and `GHC.Prim` had their
      `Typeable` representations manually defined in `GHC.Typeable.Internals`.
      This was terrible, resulting in a great deal of boilerplate and a number
      of bugs due to missing or inconsistent representations (see #11120).
      
      Here we take a different tack, initially proposed by Richard Eisenberg:
      We wire-in the `Module`, `TrName`, and `TyCon` types, allowing them to
      be used in `GHC.Types`. We then allow the usual type representation
      generation logic to handle this module.
      
      `GHC.Prim`, on the other hand, is a bit tricky as it has no object code
      of its own.  To handle this we instead place the type representations
      for the types defined here in `GHC.Types`.
      
      On the whole this eliminates several special-cases as well as a fair
      amount of boilerplate from hand-written representations. Moreover, we
      get full coverage of primitive types for free.
      
      Test Plan: Validate
      
      Reviewers: goldfire, simonpj, austin, hvr
      
      Subscribers: goldfire, simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1774
      
      GHC Trac Issues: #11120
      84b0ebed
    • Ben Gamari's avatar
      Use (&&) instead of `if` in Ix derivation · 5cce0954
      Ben Gamari authored
      We were previously using `if` in the derivation of `Ix` instances. This
      interacts badly with RebindableSyntax as the typechecker doesn't infer
      the type of the argument we give to `tagToEnum#`.
      
      Previously we produced, `if (ch >= ah) then (ch <= bh) else False`.
      
      We now produce `(ch >= ah) && (ch <= bh)`
      
      Fixes #11396.
      
      Test Plan: Validate
      
      Reviewers: austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1797
      
      GHC Trac Issues: #11396
      5cce0954
    • Simon Peyton Jones's avatar
      Oops. Add missing close-comment · 0373a845
      Simon Peyton Jones authored
      This fixes 514bac26 for Trac #11172.  Sorry!
      0373a845
    • Simon Peyton Jones's avatar
      Fix combineIdenticalAlts · 514bac26
      Simon Peyton Jones authored
      This long-standing bug in CoreUtils.combineIdenticalAlts
      was shown up by Trac #11172. The effect was that it returned
      a correct set of alternatives, but a bogus set of "impossible
      default constructors".  That meant that we subsequently
      removed all the alternatives from a case, and hence ended
      up with a bogusly empty case that should not have been empty.
      
      See Note [Care with impossible-constructors when
      combining alternatives] in CoreUtils.
      514bac26
  3. 19 Jan, 2016 5 commits
  4. 18 Jan, 2016 18 commits
    • Ben Gamari's avatar
      users-guide: Begin documenting --frontend · aff51af1
      Ben Gamari authored
      Reviewers: austin
      
      Subscribers: thomie, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D1793
      
      GHC Trac Issues: #11448
      aff51af1
    • Ben Gamari's avatar
      user-guide: Delete errant fragment · 38666bda
      Ben Gamari authored
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1796
      38666bda
    • Ben Gamari's avatar
      Hide derived OccNames from user · d2ea7f94
      Ben Gamari authored
      This hides derived OccNames from the Names returned from
      runDeclsWithLocation and clarifies the documentation. This is done to
      ensure that these names (originating from, e.g., derived Generic
      instances and type representation bindings) don't show up in ghci output
      when run with `:set +t`. This fixes #11051.
      
      Test Plan: Validate with included tests
      
      Reviewers: austin
      
      Reviewed By: austin
      
      Subscribers: thomie, hvr
      
      Differential Revision: https://phabricator.haskell.org/D1794
      
      GHC Trac Issues: #11051
      d2ea7f94
    • Ben Gamari's avatar
      ghci: Kill global macros list · cbc03f1c
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: simonmar, thomie, austin
      
      Reviewed By: austin
      
      Subscribers: alanz
      
      Differential Revision: https://phabricator.haskell.org/D1789
      cbc03f1c
    • Edward Z. Yang's avatar
      Switch from -this-package-key to -this-unit-id. · 240ddd7c
      Edward Z. Yang authored
      A small cosmetic change, but we have to do a bit of work to
      actually support it:
      
          - Cabal submodule update, so that Cabal passes us
            -this-unit-id when we ask for it.  This includes
            a Cabal renaming to be consistent with Unit ID, which
            makes ghc-pkg a bit more scrutable.
      
          - Build system is updated to use -this-unit-id rather than
            -this-package-key, to avoid deprecation warnings.  Needs
            a version test so I resurrected the old test we had
            (sorry rwbarton!)
      
          - I've *undeprecated* -package-name, so that we are in the same
            state as GHC 7.10, since the "correct" flag will have only
            entered circulation in GHC 8.0.
      
          - I removed -package-key.  Since we didn't deprecate -package-id
            I think this should not cause any problems for users; they
            can just change their code to use -package-id.
      
          - The package database is indexed by UNIT IDs, not component IDs.
            I updated the naming here.
      
          - I dropped the signatures field from ExposedModule; nothing
            was using it, and instantiatedWith from the package database
            field.
      
          - ghc-pkg was updated to use unit ID nomenclature, I removed
            the -package-key flags but I decided not to add any new flags
            for now.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: 23Skidoo, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D1780
      240ddd7c
    • Jan Stolarek's avatar
      Replace calls to `ptext . sLit` with `text` · b8abd852
      Jan Stolarek authored
      Summary:
      In the past the canonical way for constructing an SDoc string literal was the
      composition `ptext . sLit`.  But for some time now we have function `text` that
      does the same.  Plus it has some rules that optimize its runtime behaviour.
      This patch takes all uses of `ptext . sLit` in the compiler and replaces them
      with calls to `text`.  The main benefits of this patch are clener (shorter) code
      and less dependencies between module, because many modules now do not need to
      import `FastString`.  I don't expect any performance benefits - we mostly use
      SDocs to report errors and it seems there is little to be gained here.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, goldfire, hvr, alanz
      
      Subscribers: goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D1784
      b8abd852
    • Simon Marlow's avatar
      Fixes to "make clean" for the iserv dir · 817dd925
      Simon Marlow authored
      817dd925
    • Simon Peyton Jones's avatar
      Typo in comment · 54128992
      Simon Peyton Jones authored
      54128992
    • Simon Peyton Jones's avatar
      Test Trac #11379 · 8e50301f
      Simon Peyton Jones authored
      8e50301f
    • Simon Peyton Jones's avatar
      Implement scoped type variables in pattern synonyms · e2c7b7ee
      Simon Peyton Jones authored
      This fixes Trac #11351.   The implementation is pretty
      simple, happily.
      
      I took the opportunity to re-order the prov/req context
      in builder-ids, which was confusingly backwards.
      e2c7b7ee
    • Simon Peyton Jones's avatar
      8e6a68d4
    • Simon Peyton Jones's avatar
      Refactoring on IdInfo and system derived names · ec8a188a
      Simon Peyton Jones authored
      Some modest refactoring, triggered in part by Trac #11051
      
      * Kill off PatSynId, ReflectionId in IdDetails
        They were barely used, and only for pretty-printing
      
      * Add helper function Id.mkExportedVanillaId, and use it
      
      * Polish up OccName.isDerivedOccName, as a predicate for
        definitions generated internally by GHC, which we
        might not want to show to the user.
      
      * Kill off unused OccName.mkDerivedTyConOcc
      
      * Shorten the derived OccNames for newtype and data
        instance axioms
      
      * A bit of related refactoring around newFamInstAxiomName
      ec8a188a
    • Simon Peyton Jones's avatar
      Improve debug printing/warnings · 6e0c0fd2
      Simon Peyton Jones authored
      6e0c0fd2
    • 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
  5. 17 Jan, 2016 6 commits
  6. 16 Jan, 2016 3 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