[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: base: add COMPLETE pragma to BufferCodec PatSyn

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Jul 12 07:13:52 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
88272cdf by sheaf at 2023-07-12T03:13:35-04:00
base: add COMPLETE pragma to BufferCodec PatSyn

This implements CLC proposal #178, rectifying an oversight in the
implementation of CLC proposal #134 which could lead to spurious
pattern match warnings.

https://github.com/haskell/core-libraries-committee/issues/178
https://github.com/haskell/core-libraries-committee/issues/134

- - - - -
14d14eb4 by sheaf at 2023-07-12T03:13:35-04:00
exactprint: silence incomplete record update warnings

- - - - -
161137d8 by sheaf at 2023-07-12T03:13:35-04:00
Re-instate -Wincomplete-record-updates

Commit e74fc066 refactored the handling of record updates to use
the HsExpanded mechanism. This meant that the pattern matching inherent
to a record update was considered to be "generated code", and thus we
stopped emitting "incomplete record update" warnings entirely.

This commit changes the "data Origin = Source | Generated" datatype,
adding a field to the Generated constructor to indicate whether we
still want to perform pattern-match checking. We also have to do a bit
of plumbing with HsCase, to record that the HsCase arose from an
HsExpansion of a RecUpd, so that the error message continues to mention
record updates as opposed to a generic "incomplete pattern matches in case"
error.

Finally, this patch also changes the way we handle inaccessible code
warnings. Commit e74fc066 was also a regression in this regard, as we
were emitting "inaccessible code" warnings for case statements spuriously
generated when desugaring a record update (remember: the desugaring mechanism
happens before typechecking; it thus can't take into account e.g. GADT information
in order to decide which constructors to include in the RHS of the desugaring
of the record update).
We fix this by changing the mechanism through which we disable inaccessible
code warnings: we now check whether we are in generated code in
GHC.Tc.Utils.TcMType.newImplication in order to determine whether to
emit inaccessible code warnings.

Fixes #23520
Updates haddock submodule, to avoid incomplete record update warnings

- - - - -
a45e478a by sheaf at 2023-07-12T03:13:35-04:00
Propagate long-distance information in do-notation

The preceding commit re-enabled pattern-match checking inside record
updates. This revealed that #21360 was in fact NOT fixed by e74fc066.

This commit makes sure we correctly propagate long-distance information
in do blocks, e.g. in

```haskell
data T = A { fld :: Int } | B

f :: T -> Maybe T
f r = do
  a at A{} <- Just r
  Just $ case a of { A _ -> A 9 }
```

we need to propagate the fact that "a" is headed by the constructor "A"
to see that the case expression "case a of { A _ -> A 9 }" cannot fail.

Fixes #21360

- - - - -
75de112c by sheaf at 2023-07-12T03:13:35-04:00
Skip PMC for boring patterns

Some patterns introduce no new information to the pattern-match
checker (such as plain variable or wildcard patterns). We can thus
skip doing any pattern-match checking on them when the sole purpose
for doing so was introducing new long-distance information.

See Note [Boring patterns] in GHC.Hs.Pat.

Doing this avoids regressing in performance now that we do additional
pattern-match checking inside do notation.

- - - - -
140358d9 by Andreas Schwab at 2023-07-12T03:13:39-04:00
Hadrian: enable GHCi support on riscv64

- - - - -
d8229c94 by Josh Meredith at 2023-07-12T03:13:40-04:00
JavaScript: support unicode code points > 2^16 in toJSString using String.fromCodePoint (#23628)

- - - - -
9f271a5e by Matthew Pickering at 2023-07-12T03:13:40-04:00
Remove references to make build system in mk/build.mk

Fixes #23636

- - - - -
f897f690 by sheaf at 2023-07-12T03:13:44-04:00
Valid hole fits: don't panic on a Given

The function GHC.Tc.Errors.validHoleFits would end up panicking when
encountering a Given constraint. To fix this, it suffices to filter out
the Givens before continuing.

Fixes #22684

- - - - -


30 changed files:

- .gitlab/ci.sh
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match.hs-boot
- compiler/GHC/HsToCore/Match/Constructor.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Utils.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/Monad.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/056f909e96ff169efaf251a13144f0edea6893d0...f897f6908cc970f35fbbdf101bfc57bd55ab9248

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/056f909e96ff169efaf251a13144f0edea6893d0...f897f6908cc970f35fbbdf101bfc57bd55ab9248
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230712/6bd78cc6/attachment.html>


More information about the ghc-commits mailing list