[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: docs: fix ScopedTypeVariables example (#24101)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Nov 1 10:09:11 UTC 2023



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


Commits:
7a90020f by Krzysztof Gogolewski at 2023-10-31T20:03:37-04:00
docs: fix ScopedTypeVariables example (#24101)

The previous example didn't compile.

Furthermore, it wasn't demonstrating the point properly.
I have changed it to an example which shows that 'a' in the signature
must be the same 'a' as in the instance head.

- - - - -
49f69f50 by Krzysztof Gogolewski at 2023-10-31T20:04:13-04:00
Fix pretty-printing of type family dependencies

"where" should be after the injectivity annotation.

- - - - -
73c191c0 by Ben Gamari at 2023-10-31T20:04:49-04:00
gitlab-ci: Bump LLVM bootstrap jobs to Debian 12

As the Debian 10 images have too old an LLVM.

Addresses #24056.

- - - - -
5b0392e0 by Matthew Pickering at 2023-10-31T20:04:49-04:00
ci: Run aarch64 llvm backend job with "LLVM backend" label

This brings it into line with the x86 LLVM backend job.

- - - - -
ce2be6cd by Ryan Scott at 2023-11-01T06:08:56-04:00
More robust checking for DataKinds

As observed in #22141, GHC was not doing its due diligence in catching code
that should require `DataKinds` in order to use. Most notably, it was allowing
the use of arbitrary data types in kind contexts without `DataKinds`, e.g.,

```hs
data Vector :: Nat -> Type -> Type where
```

This patch revamps how GHC tracks `DataKinds`. The full specification is
written out in the `DataKinds` section of the GHC User's Guide, and the
implementation thereof is described in `Note [Checking for DataKinds]` in
`GHC.Tc.Validity`. In brief:

* We catch _type_-level `DataKinds` violations in the renamer. See
  `checkDataKinds` in `GHC.Rename.HsType` and `check_data_kinds` in
  `GHC.Rename.Pat`.

* We catch _kind_-level `DataKinds` violations in the typechecker, as this
  allows us to catch things that appear beneath type synonyms. (We do *not*
  want to do this in type-level contexts, as it is perfectly fine for a type
  synonym to mention something that requires DataKinds while still using the
  type synonym in a module that doesn't enable DataKinds.) See `checkValidType`
  in `GHC.Tc.Validity`.

* There is now a single `TcRnDataKindsError` that classifies all manner of
  `DataKinds` violations, both in the renamer and the typechecker. The
  `NoDataKindsDC` error has been removed, as it has been subsumed by
  `TcRnDataKindsError`.

* I have added `CONSTRAINT` is `isKindTyCon`, which is what checks for illicit
  uses of data types at the kind level without `DataKinds`. Previously,
  `isKindTyCon` checked for `Constraint` but not `CONSTRAINT`. This is
  inconsistent, given that both `Type` and `TYPE` were checked by `isKindTyCon`.
  Moreover, it thwarted the implementation of the `DataKinds` check in
  `checkValidType`, since we would expand `Constraint` (which was OK without
  `DataKinds`) to `CONSTRAINT` (which was _not_ OK without `DataKinds`) and
  reject it. Now both are allowed.

* I have added a flurry of additional test cases that test various corners of
  `DataKinds` checking.

Fixes #22141.

- - - - -
748c90e2 by Sylvain Henry at 2023-11-01T06:09:07-04:00
JS: fix FFI "wrapper" and "dynamic"

Fix codegen and helper functions for "wrapper" and "dynamic" foreign
imports.

Fix tests:
- ffi006
- ffi011
- T2469
- T4038

Related to #22363

- - - - -


30 changed files:

- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Types/Error/Codes.hs
- docs/users_guide/9.10.1-notes.rst
- docs/users_guide/exts/data_kinds.rst
- docs/users_guide/exts/scoped_type_variables.rst
- docs/users_guide/using-warnings.rst
- libraries/base/src/GHC/JS/Prim.hs
- rts/js/mem.js
- rts/js/rts.js
- testsuite/tests/ffi/should_run/all.T
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/polykinds/T7433.stderr
- testsuite/tests/rename/should_fail/T22478e.hs
- testsuite/tests/rename/should_fail/T22478e.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2488cbf2a7db0d0554845fb96a8478376aa5fdae...748c90e29f0ca5d639ab03030ccf4e6d3a059a2d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2488cbf2a7db0d0554845fb96a8478376aa5fdae...748c90e29f0ca5d639ab03030ccf4e6d3a059a2d
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/20231101/fb042eb7/attachment.html>


More information about the ghc-commits mailing list