From 2ef2fac4c412a25fa64f79b759d69d22a4ebc784 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Mon, 21 Sep 2020 20:07:04 -0400 Subject: Check for large tuples more thoroughly This fixes #18723 by: * Moving the existing `GHC.Tc.Gen.HsType.bigConstraintTuple` validity check to `GHC.Rename.Utils.checkCTupSize` for consistency with `GHC.Rename.Utils.checkTupSize`, and * Using `check(C)TupSize` when checking tuple _types_, in addition to checking names, expressions, and patterns. Note that I put as many of these checks as possible in the typechecker so that GHC can properly distinguish between boxed and constraint tuples. The exception to this rule is checking names, which I perform in the renamer (in `GHC.Rename.Env`) so that we can rule out `(,, ... ,,)` and `''(,, ... ,,)` alike in one fell swoop. While I was in town, I also removed the `HsConstraintTuple` and `HsBoxedTuple` constructors of `HsTupleSort`, which are functionally unused. This requires a `haddock` submodule bump. --- testsuite/tests/rename/should_fail/T6148a.stderr | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 testsuite/tests/rename/should_fail/T6148a.stderr (limited to 'testsuite/tests/rename/should_fail/T6148a.stderr') diff --git a/testsuite/tests/rename/should_fail/T6148a.stderr b/testsuite/tests/rename/should_fail/T6148a.stderr new file mode 100644 index 0000000000..e287636d4d --- /dev/null +++ b/testsuite/tests/rename/should_fail/T6148a.stderr @@ -0,0 +1,14 @@ + +T6148a.hs:3:5: error: + • A 65-tuple is too large for GHC + (max size is 64) + Workaround: use nested tuples or define a data type + • In the expression: + (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + In an equation for ‘a’: + a = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0) -- cgit v1.2.1