diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 234df36be9..9ab0ef2370 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -2670,7 +2670,9 @@ mkSumOrTuplePat l boxity (Tuple ps) = do return $ L l (PatBuilderPat (TuplePat noExtField ps' boxity)) where toTupPat :: Located (Maybe (Located (PatBuilder GhcPs))) -> PV (LPat GhcPs) - toTupPat (L l p) = case p of + -- Ignore the element location so that the error message refers to the + -- entire tuple. See #19504 (and the discussion) for details. + toTupPat (L _ p) = case p of Nothing -> addFatalError $ PsError PsErrTupleSectionInPat [] l Just p' -> checkLPat p' |