diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-10-26 16:38:46 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-10-26 16:38:46 +0100 |
commit | d32a0c810c8921e4ce585d43d9a9c55648f3fc47 (patch) | |
tree | 0f94bbb086576a5e3ad1361084ef8fb77f57b69d /testsuite/tests/th | |
parent | e65d702c3c28983709c77900a40f08af3102be8f (diff) | |
download | haskell-d32a0c810c8921e4ce585d43d9a9c55648f3fc47.tar.gz |
Test Trac #7276 (part 2)
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T7276a.script | 4 | ||||
-rw-r--r-- | testsuite/tests/th/T7276a.stdout | 21 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/th/T7276a.script b/testsuite/tests/th/T7276a.script new file mode 100644 index 0000000000..5ebd911233 --- /dev/null +++ b/testsuite/tests/th/T7276a.script @@ -0,0 +1,4 @@ +:set -XTemplateHaskell -fdefer-type-errors +import Language.Haskell.TH +let x = [d|a = ()|] :: Q Exp +:t $x diff --git a/testsuite/tests/th/T7276a.stdout b/testsuite/tests/th/T7276a.stdout new file mode 100644 index 0000000000..8c4f7afc64 --- /dev/null +++ b/testsuite/tests/th/T7276a.stdout @@ -0,0 +1,21 @@ + +<interactive>:4:9: Warning: + Couldn't match type `[Dec]' with `Exp' + Expected type: Q Exp + Actual type: DecsQ + In the Template Haskell quotation [d| a = () |] + In the expression: [d| a = () |] :: Q Exp + In an equation for `x': x = [d| a = () |] :: Q Exp + +<interactive>:1:1: + Exception when trying to run compile-time code: + <interactive>:4:9: + Couldn't match type `[Dec]' with `Exp' + Expected type: Q Exp + Actual type: DecsQ + In the Template Haskell quotation [d| a = () |] + In the expression: [d| a = () |] :: Q Exp + In an equation for `x': x = [d| a = () |] :: Q Exp +(deferred type error) + Code: x + In the expression: $x diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 6e332e2064..d74bbead75 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -253,3 +253,4 @@ test('T7064', test('T7092', extra_clean(['T7092a.hi','T7092a.o']), multimod_compile, ['T7092','-v0']) test('T7276', normal, compile_fail, ['-v0']) +test('T7276a', combined_output, ghci_script, ['T7276a.script']) |