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.
Showing
- compiler/typecheck/TcExpr.hs 9 additions, 2 deletionscompiler/typecheck/TcExpr.hs
- compiler/typecheck/TcRnDriver.hs 155 additions, 43 deletionscompiler/typecheck/TcRnDriver.hs
- testsuite/tests/typecheck/should_fail/T16453E1.hs 2 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453E1.hs
- testsuite/tests/typecheck/should_fail/T16453E1.stderr 2 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453E1.stderr
- testsuite/tests/typecheck/should_fail/T16453E2.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453E2.hs
- testsuite/tests/typecheck/should_fail/T16453E2.stderr 9 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453E2.stderr
- testsuite/tests/typecheck/should_fail/T16453S.hs 2 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453S.hs
- testsuite/tests/typecheck/should_fail/T16453T.hs 2 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T16453T.hs
- testsuite/tests/typecheck/should_fail/all.T 4 additions, 0 deletionstestsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T16453M0.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453M0.hs
- testsuite/tests/typecheck/should_run/T16453M0.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T16453M0.stdout
- testsuite/tests/typecheck/should_run/T16453M1.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453M1.hs
- testsuite/tests/typecheck/should_run/T16453M1.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T16453M1.stdout
- testsuite/tests/typecheck/should_run/T16453M2.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453M2.hs
- testsuite/tests/typecheck/should_run/T16453M2.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T16453M2.stdout
- testsuite/tests/typecheck/should_run/T16453M3.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453M3.hs
- testsuite/tests/typecheck/should_run/T16453M3.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T16453M3.stdout
- testsuite/tests/typecheck/should_run/T16453M4.hs 3 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453M4.hs
- testsuite/tests/typecheck/should_run/T16453M4.stdout 1 addition, 0 deletionstestsuite/tests/typecheck/should_run/T16453M4.stdout
- testsuite/tests/typecheck/should_run/T16453T.hs 2 additions, 0 deletionstestsuite/tests/typecheck/should_run/T16453T.hs
Please register or sign in to comment