1. 23 Jan, 2019 3 commits
    • Gabor Greif's avatar
      Minor refactor [ci skip] · b397e979
      Gabor Greif authored
    • Gabor Greif's avatar
      A few typofixes · bb2acfe0
      Gabor Greif authored
    • Alec Theriault's avatar
      Error out of invalid Int/Word bit shifts · 5341edf3
      Alec Theriault authored
      Although the Haddock's for `shiftL` and `shiftR` do require the number
      of bits to be non-negative, we should still check this before calling
      out to primitives (which also have undefined behaviour for negative bit
      If a user _really_ wants to bypass checks that the number of bits is
      sensible, they already have the aptly-named `unsafeShiftL`/`unsafeShiftR`
      at their disposal.
      See #16111.
  2. 22 Jan, 2019 1 commit
    • Simon Peyton Jones's avatar
      Fix bogus worker for newtypes · a5373c1f
      Simon Peyton Jones authored
      The "worker" for a newtype is actually a function
      with a small (compulsory) unfolding, namely a cast.
      But the construction of this function was plain wrong
      for newtype /instances/; it cast the arguemnt to the
      family type rather than the representation type.
      This never actually bit us because, in the case of a
      family instance, we immediately cast the result to
      the family type.  So we get
         \x. (x |> co1) |> co2
      where the compositio of co1 and co2 is ill-kinded.
      However the optimiser (even the simple optimiser)
      just collapsed those casts, ignoring the mis-match
      in the middle, so we never saw the problem.
      Trac #16191 is indeed a dup of #16141; but the resaon
      these tickets produce Lint errors is not the unnecessary
      forcing; it's because of the ill-typed casts.
      This patch fixes the ill-typed casts, properly.  I can't
      see a way to trigger an actual failure prior to this
      patch, but it's still wrong wrong wrong to have ill-typed
      casts, so better to get rid of them.
  3. 21 Jan, 2019 2 commits
  4. 20 Jan, 2019 2 commits
    • Matthew Pickering's avatar
      Remove TODO in HsExpr · 6e7aa5e9
      Matthew Pickering authored
      It is correct to be `GhcTc` as the data type is for expressions which are inside splices 
      so they can be delayed until desugaring. 
    • Chaitanya Koparkar's avatar
      Mention DerivingStrategies in the warning when DAC and GND are both enabled · 800d77e8
      Chaitanya Koparkar authored
      When DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled,
      GHC prints out a warning that specifies the strategy it used to
      derive a class. This patch updates the warning to mention that users
      may pick a particular strategy by using DerivingStrategies.
      Test plan: make test TEST=T16179
  5. 18 Jan, 2019 2 commits
  6. 17 Jan, 2019 10 commits
  7. 16 Jan, 2019 5 commits
  8. 15 Jan, 2019 4 commits
  9. 13 Jan, 2019 3 commits
  10. 11 Jan, 2019 2 commits
  11. 08 Jan, 2019 1 commit
    • Ryan Scott's avatar
      Be pickier about unsaturated synonyms in :kind · 6b70cf61
      Ryan Scott authored
      We currently permit any and all uses of unsaturated type
      synonyms and type families in GHCi's `:kind` command, which allows
      strange interactions like this one:
      > :set -XTypeFamilies -XPolyKinds
      > type family Id (a :: k)
      > type instance Id a = a
      > type Foo x = Maybe
      > :kind! Id Foo
      This is probably a stretch too far, so this patch moves to disallow
      unsaturated synonyms that aren't at the top level (we still want to
      allow `:kind Id`, for instance). We do this by augmenting `GhciCtxt`
      with an additional `Bool` field to indicate if we are at the
      outermost level of the type being passed to `:kind` or not. See
      `Note [Unsaturated type synonyms in GHCi]` in `TcValidity` for the
      full story.
      Test Plan: make test TEST=T16013
      Reviewers: goldfire, bgamari
      Reviewed By: goldfire
      Subscribers: simonpj, goldfire, rwbarton, carter
      GHC Trac Issues: #16013
      Differential Revision: https://phabricator.haskell.org/D5471
  12. 07 Jan, 2019 1 commit
    • Alec Theriault's avatar
      Check that libs found by GCC aren't folders · 6b5ec08a
      Alec Theriault authored
      We use 'gcc -B<base-location> --print-file-name mylib.a' as a way of
      checking if 'gcc' can discover 'mylib.a' at the given location. However,
      this can break down if there is a folder caller 'mylib.a' that 'gcc' can
      discover. We can guard against this by explicitly checking that the path
      returned by 'gcc' is a file.
      This may seem like a far-fetched scenario, but since
      3d17f1f1, we look for libraries without
      any prefix or suffix (ie. 'extra-libraries: softfloat', we look for just
      'softfloat' as well as 'softloat.a', 'softfloat.dll.a', etc.) which means
      that there might actusally be a folder of that name in one of the base
      Reviewers: Phyx, bgamari, hvr, angerman
      Reviewed By: Phyx, angerman
      Subscribers: angerman, rwbarton, carter
      GHC Trac Issues: #16063
      Differential Revision: https://phabricator.haskell.org/D5462
  13. 06 Jan, 2019 3 commits
  14. 05 Jan, 2019 1 commit