Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC Commits: 5be5da64 by Apoorv Ingle at 2026-01-19T22:37:41-06:00 fix error message for record selector T26480b - - - - - 2 changed files: - compiler/GHC/Tc/Types/Origin.hs - testsuite/tests/overloadedrecflds/should_fail/T26480b.stderr Changes: ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -881,6 +881,8 @@ pprCtOrigin (ExpansionOrigin o) OrigExpr (RecordUpd{}) -> text "a record update" OrigExpr (ExplicitList{}) -> text "an overloaded list" OrigExpr (HsIf{}) -> text "an if-then-else expression" + OrigExpr (HsProjection _ p) -> text "the record selector" <+> + quotes (ppr ((FieldLabelStrings $ fmap noLocA p))) OrigExpr e -> text "the expression" <+> (ppr e) pprCtOrigin (GivenSCOrigin sk d blk) ===================================== testsuite/tests/overloadedrecflds/should_fail/T26480b.stderr ===================================== @@ -42,7 +42,7 @@ T26480b.hs:43:12: error: [GHC-39999] T26480b.hs:47:10: error: [GHC-39999] • No instance for ‘HasField "xyzzywyzzydyzzd" G H’ - arising from the expression (.xyzzywyzzydyzzd) + arising from the record selector ‘xyzzywyzzydyzzd’ NB: ‘G’ does not have a record field named ‘xyzzywyzzydyzzd’. • In the expression: (.xyzzywyzzydyzzd) In an equation for ‘test3a’: test3a = (.xyzzywyzzydyzzd) @@ -50,7 +50,7 @@ T26480b.hs:47:10: error: [GHC-39999] T26480b.hs:50:10: error: [GHC-39999] • No instance for ‘HasField "xyzzywyzzydyzze" G H’ - arising from the expression (.field1.xyzzywyzzydyzze) + arising from the record selector ‘field1.xyzzywyzzydyzze’ NB: ‘G’ does not have a record field named ‘xyzzywyzzydyzze’. • In the expression: (.field1.xyzzywyzzydyzze) In an equation for ‘test3b’: test3b = (.field1.xyzzywyzzydyzze) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5be5da64ffeaed232cda022727a051a0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5be5da64ffeaed232cda022727a051a0... You're receiving this email because of your account on gitlab.haskell.org.