1. 20 Feb, 2019 9 commits
  2. 19 Feb, 2019 6 commits
  3. 18 Feb, 2019 4 commits
    • Alec Theriault's avatar
      Uphold AvailTC Invariant for associated data fams · 2a431640
      Alec Theriault authored
      The AvailTC was not be upheld for explicit export module
      export lists when the module contains associated data families.
      
          module A (module A) where
          class    C a  where { data T a }
          instance C () where { data T () = D }
      
      Used to (incorrectly) report avails as `[C{C, T;}, T{D;}]`. Note that
      although `T` is exported, the avail where it is the parent does _not_
      list it as its first element. This avail is now correctly listed as
      `[C{C, T;}, T{T, D;}]`.
      
      This was induces a [crash in Haddock][0].
      
      See #16077.
      
      [0]: https://github.com/haskell/haddock/issues/979
      2a431640
    • Vladislav Zavialov's avatar
      Fix warnings and fatal parsing errors · 1ffee940
      Vladislav Zavialov authored
      1ffee940
    • Simon Peyton Jones's avatar
      Get rid of tcm_smart from TyCoMapper · 1f1b9e35
      Simon Peyton Jones authored
      Following a succession of refactorings of the type checker,
      culminating in the patch
             Make a smart mkAppTyM
      we have got rid of mkNakedAppTy etc.  And that in turn
      meant that the tcm_smart field of the generic TyCoMapper
      (in Type.hs) was entirely unused.  It was always set to True.
      
      So this patch just gets rid of it completely.  Less code,
      less complexity, and more efficient because fewer higher-order
      function calls.  Everyone wins.
      
      No change in behaviour; this does not cure any bugs!
      1f1b9e35
    • Tamar Christina's avatar
      Testsuite: implement use_specs. · 0fff3ae6
      Tamar Christina authored
      0fff3ae6
  4. 17 Feb, 2019 2 commits
    • Alec Theriault's avatar
      Run some of Haddock's tests in the testsuite · 4a09d30b
      Alec Theriault authored
      The 4 main testsuites in Haddock don't have many dependencies, but are
      regularly broken in small ways by changes to the GHC AST or the GHC API.
      The main gotcha is that we'll have to make sure that `haddock-test` and
      the test suite don't add modules without modifying this test. Then again,
      if that happens, the test will fail and someone will noticed.
      4a09d30b
    • Peter Trommler's avatar
      Cmm: Promote stack arguments to word size · af7b0fdb
      Peter Trommler authored
      Smaller than word size integers must be promoted to word size
      when passed on the stack. While on little endian systems we can
      get away with writing a small integer to a word size stack slot
      and read it as a word ignoring the upper bits, on big endian
      systems a small integer write ends up in the most significant
      bits and a word size read that ignores the upper bits delivers
      a random value.
      
      On little endian systems a smaller than word size write to
      the stack might be more efficient but that decision is
      system specific and should be done as an optimization in the
      respective backends.
      
      Fixes #16258
      af7b0fdb
  5. 16 Feb, 2019 6 commits
  6. 15 Feb, 2019 4 commits
  7. 14 Feb, 2019 7 commits
    • Simon Peyton Jones's avatar
      Fail fast in solveLocalEqualities · 5c1f268e
      Simon Peyton Jones authored
      This patch makes us fail fast in TcSimplify.solveLocalEqualities,
      and in TcHsType.tc_hs_sig_type, if there are insoluble constraints.
      
      Previously we ploughed on even if there were insoluble constraints,
      leading to a cascade of hard-to-understand type errors. Failing
      eagerly is much better; hence a lot of testsuite error message
      changes.  Eg if we have
                f :: [Maybe] -> blah
                f xs = e
      then trying typecheck 'f x = e' with an utterly bogus type
      is just asking for trouble.
      
      I can't quite remember what provoked me to make this change,
      but I think the error messages are notably improved, by
      removing confusing clutter and focusing on the real error.
      5c1f268e
    • Simon Peyton Jones's avatar
      Make a smart mkAppTyM · 68278382
      Simon Peyton Jones authored
      This patch finally delivers on Trac #15952.  Specifically
      
      * Completely remove Note [The tcType invariant], along with
        its complicated consequences (IT1-IT6).
      
      * Replace Note [The well-kinded type invariant] with:
      
            Note [The Purely Kinded Type Invariant (PKTI)]
      
      * Instead, establish the (PKTI) in TcHsType.tcInferApps,
        by using a new function mkAppTyM when building a type
        application.  See Note [mkAppTyM].
      
      * As a result we can remove the delicate mkNakedXX functions
        entirely.  Specifically, mkNakedCastTy retained lots of
        extremly delicate Refl coercions which just cluttered
        everything up, and(worse) were very vulnerable to being
        silently eliminated by (say) substTy. This led to a
        succession of bug reports.
      
      The result is noticeably simpler to explain, simpler
      to code, and Richard and I are much more confident that
      it is correct.
      
      It does not actually fix any bugs, but it brings us closer.
      E.g. I hoped it'd fix #15918 and #15799, but it doesn't quite
      do so.  However, it makes it much easier to fix.
      
      I also did a raft of other minor refactorings:
      
      * Use tcTypeKind consistently in the type checker
      
      * Rename tcInstTyBinders to tcInvisibleTyBinders,
        and refactor it a bit
      
      * Refactor tcEqType, pickyEqType, tcEqTypeVis
        Simpler, probably more efficient.
      
      * Make zonkTcType zonk TcTyCons, at least if they have
        any free unification variables -- see zonk_tc_tycon
        in TcMType.zonkTcTypeMapper.
      
        Not zonking these TcTyCons was actually a bug before.
      
      * Simplify try_to_reduce_no_cache in TcFlatten (a lot)
      
      * Combine checkExpectedKind and checkExpectedKindX.
        And then combine the invisible-binder instantation code
        Much simpler now.
      
      * Fix a little bug in TcMType.skolemiseQuantifiedTyVar.
        I'm not sure how I came across this originally.
      
      * Fix a little bug in TyCoRep.isUnliftedRuntimeRep
        (the ASSERT was over-zealous).  Again I'm not certain
        how I encountered this.
      
      * Add a missing solveLocalEqualities in
        TcHsType.tcHsPartialSigType.
        I came across this when trying to get level numbers
        right.
      68278382
    • Matthew Pickering's avatar
      Implement -Wredundant-record-wildcards and -Wunused-record-wildcards · 19626218
      Matthew Pickering authored
      -Wredundant-record-wildcards warns when a .. pattern binds no variables.
      
      -Wunused-record-wildcards warns when none of the variables bound by a ..
      pattern are used.
      
      These flags are enabled by `-Wall`.
      19626218
    • Sylvain Henry's avatar
      NCG: fast compilation of very large strings (#16190) · 1d9a1d9f
      Sylvain Henry authored
      This patch adds an optimization into the NCG: for large strings
      (threshold configurable via -fbinary-blob-threshold=NNN flag), instead
      of printing `.asciz "..."` in the generated ASM source, we print
      `.incbin "tmpXXX.dat"` and we dump the contents of the string into a
      temporary "tmpXXX.dat" file.
      
      See the note for more details.
      1d9a1d9f
    • Sylvain Henry's avatar
      Add perf test for #16190 · 0f1eb88c
      Sylvain Henry authored
      0f1eb88c
    • Alec Theriault's avatar
      Add `liftedTyped` to `Lift` class · 7f26b74e
      Alec Theriault authored
      Implements GHC proposal 43, adding a `liftTyped` method to the `Lift` typeclass.
      This also adds some documentation to `TExp`, describing typed splices and their
      advantages over their untyped counterparts.
      
      Resolves #14671.
      7f26b74e
    • Alexandre Esteves's avatar
      Fix typos [skip ci] · e40f00dc
      Alexandre Esteves authored
      e40f00dc
  8. 13 Feb, 2019 2 commits