[Git][ghc/ghc][wip/int-index/hs-doc-context] Introduce TcRnWithHsDocContext (#22346)

Vladislav Zavialov (@int-index) gitlab at gitlab.haskell.org
Tue Oct 25 17:53:56 UTC 2022



Vladislav Zavialov pushed to branch wip/int-index/hs-doc-context at Glasgow Haskell Compiler / GHC


Commits:
94108806 by Vladislav Zavialov at 2022-10-25T21:52:35+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/94108806b5259d83a141d1da33f22185ac5953bb

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/94108806b5259d83a141d1da33f22185ac5953bb
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/20221025/20434309/attachment.html>


More information about the ghc-commits mailing list