[Git][ghc/ghc][wip/sand-witch/lazy-skol] 44 commits: Fix #24308

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Jan 31 13:59:44 UTC 2024



Simon Peyton Jones pushed to branch wip/sand-witch/lazy-skol at Glasgow Haskell Compiler / GHC


Commits:
b2d8cd85 by Matt Walker at 2024-01-26T09:50:08-05:00
Fix #24308

Add tests for semicolon separated where clauses

- - - - -
0da490a1 by Ben Gamari at 2024-01-26T17:34:41-05:00
hsc2hs: Bump submodule

- - - - -
3f442fd2 by Ben Gamari at 2024-01-26T17:34:41-05:00
Bump containers submodule to 0.7

- - - - -
82a1c656 by Sebastian Nagel at 2024-01-29T02:32:40-05:00
base: with{Binary}File{Blocking} only annotates own exceptions

Fixes #20886

This ensures that inner, unrelated exceptions are not misleadingly
annotated with the opened file.

- - - - -
9294a086 by Andreas Klebinger at 2024-01-29T02:33:15-05:00
Fix fma warning when using llvm on aarch64.

On aarch64 fma is always on so the +fma flag doesn't exist for that
target. Hence no need to try and pass +fma to llvm.

Fixes #24379

- - - - -
ced2e731 by sheaf at 2024-01-29T17:27:12-05:00
No shadowing warnings for NoFieldSelector fields

This commit ensures we don't emit shadowing warnings when a user
shadows a field defined with NoFieldSelectors.

Fixes #24381

- - - - -
8eeadfad by Patrick at 2024-01-29T17:27:51-05:00
Fix bug wrong span of nested_doc_comment #24378

close #24378
1. Update the start position of span in `nested_doc_comment` correctly.
and hence the spans of identifiers of haddoc can be computed correctly.
2. add test `HaddockSpanIssueT24378`.

- - - - -
a557580f by Alexey Radkov at 2024-01-30T19:41:52-05:00
Fix irrelevant dodgy-foreign-imports warning on import f-pointers by value

A test *сс018* is attached (not sure about the naming convention though).
Note that without the fix, the test fails with the *dodgy-foreign-imports*
warning passed to stderr. The warning disappears after the fix.

GHC shouldn't warn on imports of natural function pointers from C by value
(which is feasible with CApiFFI), such as

```haskell
foreign import capi "cc018.h value f" f :: FunPtr (Int -> IO ())
```

where

```c
void (*f)(int);
```

See a related real-world use-case
[here](https://gitlab.com/daniel-casanueva/pcre-light/-/merge_requests/17).
There, GHC warns on import of C function pointer `pcre_free`.

- - - - -
ca99efaf by Alexey Radkov at 2024-01-30T19:41:53-05:00
Rename test cc018 -> T24034

- - - - -
88c38dd5 by Ben Gamari at 2024-01-30T19:42:28-05:00
rts/TraverseHeap.c: Ensure that PosixSource.h is included first
- - - - -
85d0eff4 by Andrei Borzenkov at 2024-01-31T09:23:55+00:00
Lazy skolemisation for @a-binders (17594)

This patch is a preparation for @a-binders implementation.
We have to accept SigmaType in matchExpectedFunTys function
to implement them. To achieve that, I made skolemization more
lazy. This leads to

- Changing tcPolyCheck function. Now it collects skolemised
  type variables and passes a list of them into tc_match_fun,
  so they could be used as [ExpPatType] with @-binsers.
- Changing tcExprSig function, so now it only skolemises signature
  if there is `ScopedTypeVariables` extension enabled.
- Changing tcPolyExpr function. Now it goes deeper into type if type
  actually is
    1) HsPar
    2) HsLam
  In all other cases tcPolyExpr immediately skolemises a type as it was
  previously.

These changes would allow lambdas to accept invisible type arguments
in the most interesting contexts.

- - - - -
46163913 by Andrei Borzenkov at 2024-01-31T09:23:55+00:00
fixup! Lazy skolemisation for @a-binders (17594)

- - - - -
3e76e634 by Andrei Borzenkov at 2024-01-31T09:23:55+00:00
Use flag instead of [ExpPatTy]

- - - - -
3688e44f by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Big refactor

..based on conversations with Vlad and Ricahrd

Proper commit message yet to come...

- - - - -
26a39813 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Revert erroneous changes to error messages

- - - - -
761219c5 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Wibbles

- - - - -
0ea8012d by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Wibble

- - - - -
d99d5c8a by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
More improvements

- - - - -
dd01a0b1 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Tidying up

- - - - -
c8dfba89 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
More

- - - - -
4b44692f by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Yet more improvements

- - - - -
f77b873f by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Yet more

- - - - -
f70b25ba by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Wibble

- - - - -
e2ebbfa2 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Fix assertion error

- - - - -
fcaa8c81 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Move implicationNeeded check to tcSkolemiseGeneral

- - - - -
3469fae7 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Wibble

- - - - -
9c0fc973 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Comments

- - - - -
c4d346dd by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Typos and wibbles

Thanks @sheaf and @sand-wich

- - - - -
eb039b7e by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Re-add reconstructType

- - - - -
e7edf486 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Improve wibble

- - - - -
a0d9192c by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Wibbles in response to reviews

...still incomplete

- - - - -
7630ef92 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Almost done

- - - - -
2d933929 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
More wibbles

..especially putting implicationNeeded back into checkConstraints

- - - - -
7473ddf3 by Simon Peyton Jones at 2024-01-31T09:23:55+00:00
Update test results

- - - - -
d1eed620 by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Remove dead reconstructCheckType

- - - - -
25aa73a0 by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Undo HsMatchContext refactor

I have re-discovered why I did the refactor of `HsMatchContext`.

I have now put it back the way it was.  Notice the utterly horrible function
`convertHsMatchCtxt` in GHC.Tc.Gen.Match. It is a complete no-op, but it is
necessary to convert `HsMatchContext GhcRn` to `HsMatchContext GhcTc`.

If we parameterise `HsMatchContext` over the payload of `mc_fun`, thus:
```
data HsMatchContext fn
  = FunRhs
      { mc_fun        :: fn
      , .. }
```
then all is well, because
```
    HsMatchContext (LIdP (NoGhcTc GhcRn))   =   HsMatchContext (LIdP (NoGhcTc GhcTc))
```
But if we wrap it up as now, that is no longer apparent and we we have to do this
no-op conversion.

I am inclined to implement the refactor above to avoid this silly conversion.
Really all we want in `mc_fun` is a `Name`... but we can't have `mc_fun :: Name`, because
the parser can't do that.  Hence all this dancing around.  See #20415 which concludes
that we can't unravel this mess until we find someone who understands HIE.

- - - - -
ed6ce970 by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Make the right HsMatchContext for record updates

- - - - -
36e36454 by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Deal (again) with HsMatchContext

- - - - -
4b94c5f5 by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Wibbles

- - - - -
a19850fc by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Make tcExpr deal with expanded expressions directly

Going via tcApp is needlessly slow, and gives worse error messages

- - - - -
43ead69f by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Add Note [Reporting application arity errors]

- - - - -
f0de44ee by Simon Peyton Jones at 2024-01-31T09:23:56+00:00
Wibbles

- - - - -
e0e16032 by Simon Peyton Jones at 2024-01-31T13:56:58+00:00
Fast path for tcSkolemiseGeneral

- - - - -
afc99c2f by Simon Peyton Jones at 2024-01-31T13:57:11+00:00
Make deepUserTypeError_maybe more efficient

In particular, don't call funTyConAppTy_maybe so often

- - - - -


30 changed files:

- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.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/GuardedRHSs.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match.hs-boot
- 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/Parser/Lexer.x
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Expr.hs-boot
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/05745d57d470568effd8c8f1f5c76b48e25188e4...afc99c2f713b949bda0c1005515fefde232f4db0

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/05745d57d470568effd8c8f1f5c76b48e25188e4...afc99c2f713b949bda0c1005515fefde232f4db0
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/20240131/684ee138/attachment-0001.html>


More information about the ghc-commits mailing list