[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: Use export list of Main module in function TcRnDriver.hs:check_main (Fix #16453)

Marge Bot gitlab at gitlab.haskell.org
Wed Mar 25 19:17:22 UTC 2020



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


Commits:
703221f4 by Roland Senn at 2020-03-25T14:45:04-04:00
Use export list of Main module in function TcRnDriver.hs:check_main (Fix #16453)

- Provide the export list of the `Main` module as parameter to the
  `compiler/typecheck/TcRnDriver.hs:check_main` function.
- Instead of `lookupOccRn_maybe` call the function `lookupInfoOccRn`.
  It returns the list `mains_all` of all the main functions in scope.
- Select from this list `mains_all` all `main` functions that are in
  the export list of the `Main` module.
- If this new list contains exactly one single `main` function, then
  typechecking continues.
- Otherwise issue an appropriate error message.

- - - - -
3e27205a by Sebastian Graf at 2020-03-25T14:45:40-04:00
Remove -fkill-absence and -fkill-one-shot flags

They seem to be a benchmarking vestige of the Cardinality paper and
probably shouldn't have been merged to HEAD in the first place.

- - - - -
bf0a381b by Ben Gamari at 2020-03-25T15:17:12-04:00
testsuite: Fix T17786 on Windows

Fixes line ending normalization issue.

- - - - -
16987040 by Ben Gamari at 2020-03-25T15:17:12-04:00
testsuite: Fix T17786

Fix missing quoting and expected exit code.

- - - - -
bd819105 by Ben Gamari at 2020-03-25T15:17:12-04:00
testsuite: Mark T12971 as broken on Windows

Due to #17945.

- - - - -
f948a061 by Ben Gamari at 2020-03-25T15:17:13-04:00
gitlab-ci: Add FreeBSD release job

- - - - -
11a43080 by Ryan Scott at 2020-03-25T15:17:13-04:00
Run checkNewDataCon before constraint-solving newtype constructors

Within `checkValidDataCon`, we used to run `checkValidType` on the
argument types of a newtype constructor before running
`checkNewDataCon`, which ensures that the user does not attempt
non-sensical things such as newtypes with multiple arguments or
constraints. This works out in most situations, but this falls over
on a corner case revealed in #17955:

```hs
newtype T = Coercible () T => T ()
```

`checkValidType`, among other things, peforms an ambiguity check on
the context of a data constructor, and that it turn invokes the
constraint solver. It turns out that there is a special case in the
constraint solver for representational equalities (read: `Coercible`
constraints) that causes newtypes to be unwrapped (see
`Note [Unwrap newtypes first]` in `TcCanonical`). This special case
does not know how to cope with an ill formed newtype like `T`, so
it ends up panicking.

The solution is surprisingly simple: just invoke `checkNewDataCon`
before `checkValidType` to ensure that the illicit newtype
constructor context is detected before the constraint solver can
run amok with it.

Fixes #17955.

- - - - -


30 changed files:

- .gitlab-ci.yml
- compiler/GHC/Core/Op/DmdAnal.hs
- compiler/GHC/Driver/Session.hs
- compiler/basicTypes/Demand.hs
- compiler/typecheck/TcExpr.hs
- compiler/typecheck/TcRnDriver.hs
- compiler/typecheck/TcTyClsDecls.hs
- testsuite/tests/codeGen/should_compile/Makefile
- testsuite/tests/driver/Makefile
- testsuite/tests/driver/all.T
- + testsuite/tests/typecheck/should_fail/T16453E1.hs
- + testsuite/tests/typecheck/should_fail/T16453E1.stderr
- + testsuite/tests/typecheck/should_fail/T16453E2.hs
- + testsuite/tests/typecheck/should_fail/T16453E2.stderr
- + testsuite/tests/typecheck/should_fail/T16453S.hs
- + testsuite/tests/typecheck/should_fail/T16453T.hs
- + testsuite/tests/typecheck/should_fail/T17955.hs
- + testsuite/tests/typecheck/should_fail/T17955.stderr
- testsuite/tests/typecheck/should_fail/all.T
- + testsuite/tests/typecheck/should_run/T16453M0.hs
- + testsuite/tests/typecheck/should_run/T16453M0.stdout
- + testsuite/tests/typecheck/should_run/T16453M1.hs
- + testsuite/tests/typecheck/should_run/T16453M1.stdout
- + testsuite/tests/typecheck/should_run/T16453M2.hs
- + testsuite/tests/typecheck/should_run/T16453M2.stdout
- + testsuite/tests/typecheck/should_run/T16453M3.hs
- + testsuite/tests/typecheck/should_run/T16453M3.stdout
- + testsuite/tests/typecheck/should_run/T16453M4.hs
- + testsuite/tests/typecheck/should_run/T16453M4.stdout
- + testsuite/tests/typecheck/should_run/T16453T.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1e312fd9c84eb9c49f4d468ff45be79065f2a7be...11a43080518ee6e5b474b9e1d91d6758bfac9878

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1e312fd9c84eb9c49f4d468ff45be79065f2a7be...11a43080518ee6e5b474b9e1d91d6758bfac9878
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/20200325/37ab683b/attachment.html>


More information about the ghc-commits mailing list