[Git][ghc/ghc][wip/21101] 21101 Error message text for invalid record wildcard match
Sasha Bogicevic pushed to branch wip/21101 at Glasgow Haskell Compiler / GHC Commits: 74f2c890 by Sasha Bogicevic at 2026-07-13T14:16:36+02:00 21101 Error message text for invalid record wildcard match - - - - - 1 changed file: - compiler/GHC/Tc/Errors/Ppr.hs Changes: ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -359,9 +359,15 @@ instance Diagnostic TcRnMessage where -> mkSimpleDecorated $ text "character literal out of range: '\\" <> char c <> char '\'' TcRnIllegalWildcardsInConstructor con -> mkSimpleDecorated $ - vcat [ text "Illegal `{..}' notation for constructor" <+> quotes (ppr con) - , nest 2 (text "Record wildcards may not be used for constructors with unlabelled fields.") - , nest 2 (text "Possible fix: Remove the `{..}' and add a match for each field of the constructor.") + vcat [ text "The data constructor" + <+> quotes (ppr con) + <+> text "does not have named record fields, so a pattern match" + <+> quotes (ppr con) + <+> text " { .. } is incorrect." + , text "Possible fixes:" + , nest 2 (text "* Replace the pattern '" <+> quotes (ppr con) <+> text "'{ .. }' with" <+> quotes (ppr con)) + , nest 2 (text "* Replace the pattern '" <+> quotes (ppr con) <+> text "'{ .. }' with" <+> quotes (ppr con) <+> text "{}") + , nest 4 (text "This version works even if you add/remove fields to " <+> quotes (ppr con) <+> text "later") ] TcRnIgnoringAnnotations anns -> mkSimpleDecorated $ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/74f2c89006e04ace55680d082dcccc24... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/74f2c89006e04ace55680d082dcccc24... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Sasha Bogicevic (@Bogicevic)