summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-11-15 09:02:11 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-11-15 11:50:52 +0000
commitae2c9b40f5b6bf272251d1f4107c60003f541b62 (patch)
treeeb786f1cd10c872df876871a44baf7a2ef97abef /testsuite/tests/printer
parent0ce66be953becf7c9de3cbea406953306b4db3b1 (diff)
downloadhaskell-ae2c9b40f5b6bf272251d1f4107c60003f541b62.tar.gz
Smarter HsType pretty-print for promoted datacons
Fix Trac #15898, by being smarter about when to print a space before a promoted data constructor, in a HsType. I had to implement a mildly tiresome function HsType.lhsTypeHasLeadingPromotionQuote It has multiple cases, of course, but it's very simple. The patch improves the error-message output in a bunch of cases, and (to my surprise) actually fixes a bug in the output of T14343 (Trac #14343), thus - In the expression: _ :: Proxy '('( 'True, 'False), 'False) + In the expression: _ :: Proxy '( '( 'True, 'False), 'False) I discovered that there were two copies of the PromotionFlag type (a boolean, with helpfully named data cons), one in IfaceType and one in HsType. So I combined into one, PromotionFlag, and moved it to BasicTypes. That's why quite a few files are touched, but it's all routine.
Diffstat (limited to 'testsuite/tests/printer')
-rw-r--r--testsuite/tests/printer/T14343.stderr8
-rw-r--r--testsuite/tests/printer/T14343b.stderr12
2 files changed, 10 insertions, 10 deletions
diff --git a/testsuite/tests/printer/T14343.stderr b/testsuite/tests/printer/T14343.stderr
index 1bceb67403..5865669302 100644
--- a/testsuite/tests/printer/T14343.stderr
+++ b/testsuite/tests/printer/T14343.stderr
@@ -13,8 +13,8 @@ T14343.hs:10:9: error:
T14343.hs:11:9: error:
• Found hole: _ :: Proxy '[ '[1]]
- • In the expression: _ :: Proxy '['[1]]
- In an equation for ‘test2’: test2 = _ :: Proxy '['[1]]
+ • In the expression: _ :: Proxy '[ '[1]]
+ In an equation for ‘test2’: test2 = _ :: Proxy '[ '[1]]
• Relevant bindings include
test2 :: Proxy '[ '[1]] (bound at T14343.hs:11:1)
Valid hole fits include
@@ -25,8 +25,8 @@ T14343.hs:11:9: error:
T14343.hs:12:9: error:
• Found hole: _ :: Proxy '[ '("Symbol", 1)]
- • In the expression: _ :: Proxy '['("Symbol", 1)]
- In an equation for ‘test3’: test3 = _ :: Proxy '['("Symbol", 1)]
+ • In the expression: _ :: Proxy '[ '("Symbol", 1)]
+ In an equation for ‘test3’: test3 = _ :: Proxy '[ '("Symbol", 1)]
• Relevant bindings include
test3 :: Proxy '[ '("Symbol", 1)] (bound at T14343.hs:12:1)
Valid hole fits include
diff --git a/testsuite/tests/printer/T14343b.stderr b/testsuite/tests/printer/T14343b.stderr
index 1954f9465a..7573169414 100644
--- a/testsuite/tests/printer/T14343b.stderr
+++ b/testsuite/tests/printer/T14343b.stderr
@@ -1,8 +1,8 @@
T14343b.hs:10:9: error:
• Found hole: _ :: Proxy '( 'True, 'False)
- • In the expression: _ :: Proxy '( 'True, 'False)
- In an equation for ‘test1’: test1 = _ :: Proxy '( 'True, 'False)
+ • In the expression: _ :: Proxy '( 'True, 'False)
+ In an equation for ‘test1’: test1 = _ :: Proxy '( 'True, 'False)
• Relevant bindings include
test1 :: Proxy '( 'True, 'False) (bound at T14343b.hs:10:1)
Valid hole fits include
@@ -13,9 +13,9 @@ T14343b.hs:10:9: error:
T14343b.hs:11:9: error:
• Found hole: _ :: Proxy '( '( 'True, 'False), 'False)
- • In the expression: _ :: Proxy '('( 'True, 'False), 'False)
+ • In the expression: _ :: Proxy '( '( 'True, 'False), 'False)
In an equation for ‘test2’:
- test2 = _ :: Proxy '('( 'True, 'False), 'False)
+ test2 = _ :: Proxy '( '( 'True, 'False), 'False)
• Relevant bindings include
test2 :: Proxy '( '( 'True, 'False), 'False)
(bound at T14343b.hs:11:1)
@@ -28,8 +28,8 @@ T14343b.hs:11:9: error:
T14343b.hs:12:9: error:
• Found hole: _ :: Proxy '( '[1], 'False)
- • In the expression: _ :: Proxy '('[1], 'False)
- In an equation for ‘test3’: test3 = _ :: Proxy '('[1], 'False)
+ • In the expression: _ :: Proxy '( '[1], 'False)
+ In an equation for ‘test3’: test3 = _ :: Proxy '( '[1], 'False)
• Relevant bindings include
test3 :: Proxy '( '[1], 'False) (bound at T14343b.hs:12:1)
Valid hole fits include