Skip to content

Check for large tuples more thoroughly

Ryan Scott requested to merge wip/T18723 into master

This fixes #18723 (closed) 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.

Edited by Ryan Scott

Merge request reports