[Git][ghc/ghc][master] Introduce TcRnWithHsDocContext (#22346)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Oct 26 04:02:16 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
0270cc54 by Vladislav Zavialov at 2022-10-26T00:02:01-04:00
Introduce TcRnWithHsDocContext (#22346)

Before this patch, GHC used withHsDocContext to attach an HsDocContext
to an error message:

	addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt msg)

The problem with this approach is that it only works with
TcRnUnknownMessage. But could we attach an HsDocContext to a
structured error message in a generic way? This patch solves
the problem by introducing a new constructor to TcRnMessage:

	data TcRnMessage where
	  ...
	  TcRnWithHsDocContext :: !HsDocContext -> !TcRnMessage -> TcRnMessage
	  ...

- - - - -


30 changed files:

- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Types/Error/Codes.hs
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInPatternSignature.stderr
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInTypeSpliceUsed.stderr
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotLast.stderr
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardTwice.stderr
- testsuite/tests/partial-sigs/should_fail/NestedExtraConstraintsWildcard.stderr
- testsuite/tests/partial-sigs/should_fail/NestedNamedExtraConstraintsWildcard.stderr
- testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature.stderr
- testsuite/tests/partial-sigs/should_fail/PartialClassMethodSignature2.stderr
- testsuite/tests/partial-sigs/should_fail/T12039.stderr
- testsuite/tests/partial-sigs/should_fail/T13324_fail1.stderr
- testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard1.stderr
- testsuite/tests/partial-sigs/should_fail/UnnamedConstraintWildcard2.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInADT1.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInADT2.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInADT3.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInADTContext1.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInDefault.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInDefaultSignature.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInDeriving.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInForeignExport.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInForeignImport.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInGADT1.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInGADT2.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0270cc54481bef9630274e77c2750940c1a4eff5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0270cc54481bef9630274e77c2750940c1a4eff5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221026/f8b4e69f/attachment.html>


More information about the ghc-commits mailing list