diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-07-27 07:00:23 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-07-27 07:00:23 +0100 |
commit | 9d799482e2b8ff4f4ec2b166e46295b5c1356ec0 (patch) | |
tree | 881ae2e24c04af716ed108156d3dc3c5aa215a47 | |
parent | c25980fec9c7b1bc3151c3f6ffa0d051c4a8a6e9 (diff) | |
download | haskell-9d799482e2b8ff4f4ec2b166e46295b5c1356ec0.tar.gz |
Simplify TH_unresolvedInfix2
-rw-r--r-- | testsuite/tests/th/TH_unresolvedInfix2.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/th/TH_unresolvedInfix2.stderr | 33 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 6 |
3 files changed, 35 insertions, 16 deletions
diff --git a/testsuite/tests/th/TH_unresolvedInfix2.hs b/testsuite/tests/th/TH_unresolvedInfix2.hs index 5cd8332c90..e480c09073 100644 --- a/testsuite/tests/th/TH_unresolvedInfix2.hs +++ b/testsuite/tests/th/TH_unresolvedInfix2.hs @@ -1,6 +1,14 @@ module TH_unresolvedInfix2 where -import TH_unresolvedInfix_Lib import Language.Haskell.TH -expr = $( infixE Nothing plus (Just $ n +? n) ) +infixl 6 :+ + +data Tree = N + | Tree :+ Tree + | Tree :* Tree + +-- Should fail +expr = $( let plus = conE '(:+) + n = conE 'N + in infixE Nothing plus (Just $ uInfixE n plus n) ) diff --git a/testsuite/tests/th/TH_unresolvedInfix2.stderr b/testsuite/tests/th/TH_unresolvedInfix2.stderr index 44c43243a1..a23cd4ae91 100644 --- a/testsuite/tests/th/TH_unresolvedInfix2.stderr +++ b/testsuite/tests/th/TH_unresolvedInfix2.stderr @@ -1,12 +1,23 @@ -TH_unresolvedInfix2.hs:6:11: - The operator `:+' [infixl 6] of a section - must have lower precedence than that of the operand, - namely `:+' [infixl 6] - in the section: `:+ N :+ N' - In the result of the splice: - $(infixE Nothing plus (Just $ n +? n)) - To see what the splice expanded to, use -ddump-splices - In the expression: $(infixE Nothing plus (Just $ n +? n)) - In an equation for `expr': - expr = $(infixE Nothing plus (Just $ n +? n)) +TH_unresolvedInfix2.hs:12:11: + The operator `:+' [infixl 6] of a section + must have lower precedence than that of the operand, + namely `:+' [infixl 6] + in the section: `:+ N :+ N' + In the result of the splice: + $(let + plus = conE ':+ + n = conE 'N + in infixE Nothing plus (Just $ uInfixE n plus n)) + To see what the splice expanded to, use -ddump-splices + In the expression: + $(let + plus = conE ... + n = conE ... + in infixE Nothing plus (Just $ uInfixE n plus n)) + In an equation for `expr': + expr + = $(let + plus = ... + .... + in infixE Nothing plus (Just $ uInfixE n plus n)) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 347466b241..c3a6802e12 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -189,6 +189,6 @@ test('TH_unresolvedInfix', multimod_compile_and_run, ['TH_unresolvedInfix.hs', '-v0']) test('TH_unresolvedInfix2', - extra_clean(['TH_unresolvedInfix_Lib.hi', 'TH_unresolvedInfix_Lib.o']), - multimod_compile_fail, - ['TH_unresolvedInfix2.hs', '-v0']) + normal, + compile_fail, + ['-v0']) |