don't print empty contexts in errors

This commit is contained in:
rhiannon morris 2023-03-26 16:10:39 +02:00
parent 84e1cc78cc
commit 46e13c8ca2
3 changed files with 16 additions and 3 deletions

View file

@ -300,12 +300,12 @@ parameters {auto _ : (Eq q, IsQty q, PrettyHL q)} (unicode : Bool)
where
inTContext : TyContext q d n -> Doc HL -> Doc HL
inTContext ctx doc =
if showContext then
if showContext && not (null ctx) then
vsep [sep ["in context", prettyTyContext unicode ctx], doc]
else doc
inEContext : EqContext q n -> Doc HL -> Doc HL
inEContext ctx doc =
if showContext then
if showContext && not (null ctx) then
vsep [sep ["in context", prettyEqContext unicode ctx], doc]
else doc