1. 12 Jun, 2015 1 commit
    • Simon Marlow's avatar
      Add parseExpr and compileParsedExpr and use them in GHC API and GHCi · d20031d4
      Simon Marlow authored
      Summary:
      This commit brings following changes and fixes:
      
       * Implement parseExpr and compileParsedExpr;
       * Fix compileExpr and dynCompilerExpr, which returned `()` for empty expr;
       * Fix :def and :cmd, which didn't work if `IO` or `String` is not in scope;
       * Use GHCiMonad instead IO in :def and :cmd;
       * Clean PrelInfo: delete dead comment and duplicate entries, add assertion.
      
      See new tests for more details.
      
      Test Plan: ./validate
      
      Reviewers: austin, dterei, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D974
      
      GHC Trac Issues: #10508
      d20031d4
  2. 11 Jun, 2015 8 commits
    • Edward Z. Yang's avatar
      Revert "Support for multiple signature files in scope." · bac927b9
      Edward Z. Yang authored
      This reverts commit a7524eae.
      bac927b9
    • Edward Z. Yang's avatar
      Add failing test for #9562. · 23582b0c
      Edward Z. Yang authored
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      23582b0c
    • thomie's avatar
      Testsuite: change some expect_fail tests to expect_broken · 5e66a698
      thomie authored
      Change the following tests from expect_fail to expect_broken: and list
      the ticket number:
      
          * driver/sigof03m/sigof03 (#9252)
          * driver/static001 (#8127)
          * partial-sigs/should_compile/EqualityConstraint (#9478)
          * partial-sigs/should_compile/ExtraNumAMROn (#9478)
          * partial-sigs/should_compile/PatBind2 (#9478)
          * partial-sigs/should_fail/TidyClash2 (#9478)
          * simplCore/should_compile/T8832 (#8832)
      
      The following tests are still marked as expect_fail, but it is not
      clearly documented why so:
      
          * gadt/lazypatok
          * indexed-types/should_fail/SkolemOccursLoop
      
      All other expect_fail tests are only expected to fail on either a
      certain platform/os or for a certain way only.
      
      Differential Revision: https://phabricator.haskell.org/D966
      5e66a698
    • thomie's avatar
      Testsuite: mark T4945 as expect_broken (#4945) · 506522c9
      thomie authored
      In commit 7d519dab, the file
      T4945.stdout was added to the repository, to make T4945 pass
      validatation presumably.
      
      When that test produces output however, there is a bug somewhere, and we
      shouldn't hide it. There is a comment in the Makefile which says:
      
          "When SpecConstr works there are no STUArrays at all"
      
      So here we remove T4945.stdout again, mark T4945 as expect_broken, and
      reopen the ticket.
      
      Differential Revision: https://phabricator.haskell.org/D976
      506522c9
    • thomie's avatar
      Testsuite: mark tests as expect_broken on win64 · a765f72c
      thomie authored
      Tickets: #1407, #9381, #9878.
      
      Differential Revision: https://phabricator.haskell.org/D977
      a765f72c
    • thomie's avatar
      Testsuite Windows: fix T8172 (#8172) · da84fd54
      thomie authored
      Use the new function `normalise_drive_letter` to change D:\ to C:\
      before comparing outputs.
      da84fd54
    • Simon Peyton Jones's avatar
      c0dc79fb
    • Simon Peyton Jones's avatar
      Another major improvement of "improvement" · ddbb97d0
      Simon Peyton Jones authored
      I wasn't very happy with my fix to Trac #10009. This is much better.
      
      The main idea is that the inert set now contains a "model", which
      embodies *all* the (nominal) equalities that we know about, with
      a view to exposing unifications.  This requires a lot fewer iterations
      of the solver than before.
      
      There are extensive comments in
       TcSMonad:  Note [inert_model: the inert model]
                  Note [Adding an inert canonical constraint the InertCans]
      
      The big changes are
      
        * New inert_model field in InertCans
      
        * Functions addInertEq, addInertCan deal with adding a
          constraint, maintaining the model
      
        * A nice improvement is that unification variables can
          unify with fmvs, so that from, say   alpha ~ fmv
          we get              alpha := fmv
          See Note [Orientation of equalities with fmvs] in TcFlatten
          It's still not perfect, as the Note explains
      
      New flag -fconstraint-solver-iterations=n, allows us to control
      the number of constraint solver iterations, and in particular
      will flag up when it's more than a small number.
      
      Performance is generally slightly better:
      T5837 is a lot better for some reason.
      ddbb97d0
  3. 09 Jun, 2015 4 commits
    • thomie's avatar
      Testsuite: delete expect_fail setups for ghc < 7.1 · 3445947a
      thomie authored
      This makes it easier to grep for expect_fail in the tests directory.
      
      Differential Revision: https://phabricator.haskell.org/D965
      3445947a
    • thomie's avatar
      Testsuite: delete expect_fail setups for hugs · 43ebe24a
      thomie authored
      This makes it easier to grep for expect_fail in the tests directory.
      
      Differential Revision: https://phabricator.haskell.org/D964
      43ebe24a
    • Zejun Wu's avatar
      Always force the exception in enqueued commands · 3b55659d
      Zejun Wu authored
      `enqueueCommands` should always force exception in commands. Otherwise
      the exception thrown in `:cmd` (e.g. `:cmd return $ head []`) will cause
      GHCi to terminate with panic.
      
      Test Plan: `cd testsuite/tests/ghci/ && make`
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D967
      
      GHC Trac Issues: #10501
      3b55659d
    • thomasw's avatar
      Refactor wild card renaming · 058af6c9
      thomasw authored
      Summary:
      Refactor wild card error reporting
      
      * Merge `HsWildcardTy` and `HsNamedWildcardTy` into one constructor
        `HsWildCardTy` with as field the new type `HsWildCardInfo`, which has two
        constructors: `AnonWildCard` and `NamedWildCard`.
      
      * All partial type checks are removed from `RdrHsSyn.hs` and are now done
        during renaming in order to report better error messages. When wild cards
        are allowed in a type, the new function `rnLHsTypeWithWildCards` (or
        `rnHsSigTypeWithWildCards`) should be used. This will bring the named wild
        cards into scope before renaming them. When this is not done, renaming will
        trigger "Unexpected wild card..." errors.
      
        Unfortunately, this has to be done separately for anonymous wild cards
        because they are given a fresh name during renaming, so they will not cause
        an out-of-scope error. They are handled in `tc_hs_type`, as a special case
        of a lookup that fails.
      
        The previous opt-out approach is replaced with an opt-in approach. No mo...
      058af6c9
  4. 05 Jun, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Fix #10489 · 61b96a86
      eir@cis.upenn.edu authored
      Dang, roles are annoying.
      
      Test case: typecheck/should_compile/T10489
      61b96a86
  5. 04 Jun, 2015 4 commits
    • thomie's avatar
      Testsuite: don't show compile/link info for some tests · 0686d76f
      thomie authored
      This info is not needed in the testlogs, and was actually making these
      tests fail on my machine because of some bug with the timeout program:
      ...
      [1 of 1] Compiling Main ( OutOfHeap.hs, tmp_T9579_outofheap_rtssome/Main.o )
      Linking T9579_outofheap_rtsnone ...
      ...
      0686d76f
    • thomie's avatar
      Testsuite: ignore `stdcall attribute ignored` (#1288) · 07feab19
      thomie authored
      That warning is only shown on some platforms, and is I believe harmless.
      07feab19
    • 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
    • thomie's avatar
      Re-center perf numbers for haddock.compiler · d8f66f1b
      thomie authored
      Summary:
      Phabricator/Harbormaster measured the following allocation numbers for
      haddock.compiler:
      
      Expected:     33562468736
      June 2nd [1]: 36740649320
      Upper bound:  36918715610
      June 3rd [2]: 36956620504
      
      So although this test didn't start failing until June 2nd/3rd, the
      biggest increase in allocation must have occured sometime before that.
      
      [1] 2f0011ac
      [2] 942cfa4e
      
      Test Plan: validate
      
      Reviewers: austin
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D948
      d8f66f1b
  6. 03 Jun, 2015 2 commits
  7. 02 Jun, 2015 7 commits
  8. 01 Jun, 2015 9 commits
    • Simon Peyton Jones's avatar
      Set 32-bit perf figure · dbcdfe23
      Simon Peyton Jones authored
      dbcdfe23
    • Simon Peyton Jones's avatar
      Mark sigof02 tests as expect_broken · 90fde522
      Simon Peyton Jones authored
      Consequence of the GlobalRdrEnv refactoring;
      see Trac #10472
      90fde522
    • Simon Peyton Jones's avatar
      Refactor the GlobalRdrEnv, fixing #7672 · 9b73cb16
      Simon Peyton Jones authored
      This patch started innocently enough, by deleting a single
      call from rnImportDecl, namely
      
          let gbl_env = mkGlobalRdrEnv (filterOut from_this_mod gres)
      
      The 'filterOut' makes no sense, and was the cause of #7672.
      
      But that little loose end led to into a twisty maze of little
      passages, all alike, which has taken me an unreasonably long
      time to straighten out. Happily, I think the result is really
      much better.
      
      In particular:
      
       * INVARIANT 1 of the GlobalRdrEnv type was simply not true:
         we had multiple GlobalRdrElts in a list with the same
         gre_name field. This kludgily implmented one form of
         shadowing.
      
       * Meanwhile, extendGlobalRdrEnvRn implemented a second form of
         shadowing, by deleting stuff from the GlobalRdrEnv.
      
       * In turn, much of this shadowing stuff depended on the Names of
         the Ids bound in the GHCi InteractiveContext being Internal
         names, even though the TyCons and suchlike all had External
         Names. Very confusing.
      
      So I have made the following changes
      
       * I re-established INVARIANT 1 of GlobalRdrEnv.  As a result
         some strange code in RdrName.pickGREs goes away.
      
       * RnNames.extendGlobalRdrEnvRn now makes one call to deal with
         shadowing, where necessary, and another to extend the
         environment.  It deals separately with duplicate bindings.
      
         The very complicated RdrName.extendGlobalRdrEnv becomes much
         simpler; we need to export the shadowing function, now called
         RdrName.shadowNames; and we can nuke
         RdrName.findLocalDupsRdrEnv altogether.
      
         RdrName Note [GlobalRdrEnv shadowing] summarises the shadowing
         story
      
       * The Names of the Ids bound in the GHCi interactive context are
         now all External.  See Note [Interactively-bound Ids in GHCi]
         in HscTypes.
      
       * Names for Ids created by the debugger are now made by
         IfaceEnv.newInteractiveBinder.  This fixes a lurking bug which
         was that the debugger was using mkNewUniqueSupply 'I' to make
         uniques, which does NOT guarantee a fresh supply of uniques on
         successive calls.
      
       * Note [Template Haskell ambiguity] in RnEnv shows that one TH-related
         error is reported lazily (on occurrences) when it might be better
         reported when extending the environment.  In some (but not all) cases
         this was done before; but now it's uniformly at occurrences.  In
         some ways it'd be better to report when extending the environment,
         but it's a tiresome test and the error is rare, so I'm leaving it
         at the lookup site for now, with the above Note.
      
       * A small thing: RnNames.greAvail becomes RdrName.availFromGRE, where
         it joins the dual RdrName.gresFromAvail.
      9b73cb16
    • Herbert Valerio Riedel's avatar
      Re-center perf numbers for T5631 · 34dcf8a0
      Herbert Valerio Riedel authored
      7dd0ea74 seems to have tipped this one over,
      although 7dd0ea74 itself had only a minimal impact on my local system.
      
      Locally, I measured right before 7dd0ea74:
      
        Expected    T5631(normal) bytes allocated: 776121120 +/-5%
        Actual      T5631(normal) bytes allocated: 811973144
        Deviation   T5631(normal) bytes allocated:       4.6 %
      
      and at 7dd0ea74:
      
        Expected    T5631(normal) bytes allocated: 776121120 +/-5%
        Actual      T5631(normal) bytes allocated: 812288344
        Deviation   T5631(normal) bytes allocated:       4.7 %
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D936
      34dcf8a0
    • Edward Z. Yang's avatar
      Add (failing) test case for #7672. · a27fb46f
      Edward Z. Yang authored
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      a27fb46f
    • Alan Zimmerman's avatar
      ApiAnnotations : strings in warnings do not return SourceText · e6191d1c
      Alan Zimmerman authored
      Summary:
      The strings used in a WARNING pragma are captured via
      
          strings :: { Located ([AddAnn],[Located FastString]) }
              : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) }
          ..
      
      The STRING token has a method getSTRINGs that returns the original
      source text for a string.
      
      A warning of the form
      
          {-# WARNING Logic
                    , mkSolver
                    , mkSimpleSolver
                    , mkSolverForLogic
                    , solverSetParams
                    , solverPush
                    , solverPop
                    , solverReset
                    , solverGetNumScopes
                    , solverAssertCnstr
                    , solverAssertAndTrack
                    , solverCheck
                    , solverCheckAndGetModel
                    , solverGetReasonUnknown
                    "New Z3 API support is still incomplete and fragile: \
                    \you may experience segmentation faults!"
            #-}
      
      returns the concatenated warning string rather than the original source.
      
      This patch now deals with all remaining instances of getSTRING to bring
      in a SourceText for each.
      
      This updates the haddock submodule as well, for the AST change.
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin, goldfire
      
      Reviewed By: austin
      
      Subscribers: bgamari, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D907
      
      GHC Trac Issues: #10313
      e6191d1c
    • Alan Zimmerman's avatar
      ApiAnnotations : rationalise tests · e00910b0
      Alan Zimmerman authored
      Summary:
      At the moment the API Annotations tests have a driver that has been
      copy/pasted multiple times.
      
      Compile it once, and run it for each test case.
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin
      
      Reviewed By: austin
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D913
      
      GHC Trac Issues: #10452
      e00910b0
    • rwbarton's avatar
      In ghci linker, link against all previous temp sos (#10322) · a52f1444
      rwbarton authored
      The OS X dlopen() appears to only resolve undefined symbols in
      the direct dependencies of the shared library it is loading.
      
      Reviewed By: trommler, austin
      
      Differential Revision: https://phabricator.haskell.org/D852
      
      GHC Trac Issues: #10322
      a52f1444
    • archblob's avatar
      Catch canonicalizePath exceptions, fix #10101 · 47564389
      archblob authored
      Summary:
      Introduce by #95 'canonicalizePath' throws and exception when given
      an invalid file in a call to 'sameFile'.
      
      There are two cases when this can happen when using ghci:
        1) If there is an error at the interactive prompt, "<interactive>"
           file is searched for and not found.
        2) If there is an error in any loaded file and editing an inexistent/new
           file with 'e: foo'.
      
      Both cases are now tested.
      
      Test Plan: validate
      
      Reviewers: austin, #ghc
      
      Reviewed By: austin, #ghc
      
      Subscribers: bgamari, thomie
      
      Differential Revision: https://phabricator.haskell.org/D930
      
      GHC Trac Issues: #10101
      47564389
  9. 31 May, 2015 2 commits
  10. 29 May, 2015 1 commit
  11. 27 May, 2015 1 commit
    • Alan Zimmerman's avatar
      ApiAnnotations tweaks · c5911479
      Alan Zimmerman authored
      Summary:
      A collection of minor updates for the API Annotations.
      
      1. The annotations for the implicity parameter is disconnected in the
         following
      
          type MPI = ?mpi_secret :: MPISecret
      
      2. In the following, the annotation for one of the commas is disconeected.
      
          mkPoli = mkBila . map ((,,(),,()) <$> P.base <*> P.pos <*> P.form)
      
      3. In the following, the annotation for the parens becomes disconnected
      
          data MaybeDefault v where
              SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v
              SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v
                                                      -> a -> MaybeDefault [a])
      
      Test Plan: ./validate
      
      Reviewers: hvr, austin
      
      Reviewed By: austin
      
      Subscribers: bgamari, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D901
      
      GHC Trac Issues: #10399
      c5911479