diff options
Diffstat (limited to 'testsuite')
27 files changed, 59 insertions, 34 deletions
diff --git a/testsuite/tests/annotations/should_fail/annfail03.stderr b/testsuite/tests/annotations/should_fail/annfail03.stderr index 05e05a6bee..625b5d1b47 100644 --- a/testsuite/tests/annotations/should_fail/annfail03.stderr +++ b/testsuite/tests/annotations/should_fail/annfail03.stderr @@ -1,6 +1,6 @@ annfail03.hs:17:11: GHC stage restriction: - ‘InModule’ is used in a top-level splice or annotation, + ‘InModule’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally In the annotation: {-# ANN f InModule #-} diff --git a/testsuite/tests/annotations/should_fail/annfail04.stderr b/testsuite/tests/annotations/should_fail/annfail04.stderr index bb638bc2ab..0226a40134 100644 --- a/testsuite/tests/annotations/should_fail/annfail04.stderr +++ b/testsuite/tests/annotations/should_fail/annfail04.stderr @@ -2,6 +2,6 @@ annfail04.hs:14:12: GHC stage restriction: instance for ‘Thing - Int’ is used in a top-level splice or annotation, + Int’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally In the annotation: {-# ANN f (thing :: Int) #-} diff --git a/testsuite/tests/annotations/should_fail/annfail06.stderr b/testsuite/tests/annotations/should_fail/annfail06.stderr index 6bae2c11b7..7a7f715fe4 100644 --- a/testsuite/tests/annotations/should_fail/annfail06.stderr +++ b/testsuite/tests/annotations/should_fail/annfail06.stderr @@ -2,6 +2,6 @@ annfail06.hs:22:1: GHC stage restriction: instance for ‘Data - InstancesInWrongModule’ is used in a top-level splice or annotation, + InstancesInWrongModule’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally In the annotation: {-# ANN f InstancesInWrongModule #-} diff --git a/testsuite/tests/annotations/should_fail/annfail09.stderr b/testsuite/tests/annotations/should_fail/annfail09.stderr index f0a03aee9c..35bdaf7b48 100644 --- a/testsuite/tests/annotations/should_fail/annfail09.stderr +++ b/testsuite/tests/annotations/should_fail/annfail09.stderr @@ -1,6 +1,6 @@ annfail09.hs:11:11: GHC stage restriction: - ‘g’ is used in a top-level splice or annotation, + ‘g’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally In the annotation: {-# ANN f g #-} diff --git a/testsuite/tests/quasiquotation/T3953.stderr b/testsuite/tests/quasiquotation/T3953.stderr index 0a067dd4b2..99c63b1c97 100644 --- a/testsuite/tests/quasiquotation/T3953.stderr +++ b/testsuite/tests/quasiquotation/T3953.stderr @@ -1,2 +1,4 @@ -T3953.hs:5:7: Not in scope: ‘notDefinedHere’ +T3953.hs:5:7: + Not in scope: ‘notDefinedHere’ + In the quasi-quotation: [notDefinedHere| |] diff --git a/testsuite/tests/quasiquotation/qq001/qq001.stderr b/testsuite/tests/quasiquotation/qq001/qq001.stderr index aa748e60cd..350dd418c0 100644 --- a/testsuite/tests/quasiquotation/qq001/qq001.stderr +++ b/testsuite/tests/quasiquotation/qq001/qq001.stderr @@ -1,4 +1,6 @@ qq001.hs:7:16: - GHC stage restriction: parse - is used in a quasiquote, and must be imported, not defined locally + GHC stage restriction: + ‘parse’ is used in a top-level splice, quasi-quote, or annotation, + and must be imported, not defined locally + In the quasi-quotation: [parse||] diff --git a/testsuite/tests/quasiquotation/qq002/qq002.stderr b/testsuite/tests/quasiquotation/qq002/qq002.stderr index b32b5ac6a0..12ab3751dd 100644 --- a/testsuite/tests/quasiquotation/qq002/qq002.stderr +++ b/testsuite/tests/quasiquotation/qq002/qq002.stderr @@ -1,4 +1,6 @@ qq002.hs:8:10: - GHC stage restriction: parse - is used in a quasiquote, and must be imported, not defined locally + GHC stage restriction: + ‘parse’ is used in a top-level splice, quasi-quote, or annotation, + and must be imported, not defined locally + In the quasi-quotation: [parse||] diff --git a/testsuite/tests/quasiquotation/qq003/qq003.stderr b/testsuite/tests/quasiquotation/qq003/qq003.stderr index a1f490fb2c..dd7fa8c872 100644 --- a/testsuite/tests/quasiquotation/qq003/qq003.stderr +++ b/testsuite/tests/quasiquotation/qq003/qq003.stderr @@ -1,4 +1,6 @@ qq003.hs:5:26: - GHC stage restriction: parse - is used in a quasiquote, and must be imported, not defined locally + GHC stage restriction: + ‘parse’ is used in a top-level splice, quasi-quote, or annotation, + and must be imported, not defined locally + In the quasi-quotation: [parse||] diff --git a/testsuite/tests/quasiquotation/qq004/qq004.stderr b/testsuite/tests/quasiquotation/qq004/qq004.stderr index be61788926..7cd33e1e6f 100644 --- a/testsuite/tests/quasiquotation/qq004/qq004.stderr +++ b/testsuite/tests/quasiquotation/qq004/qq004.stderr @@ -1,4 +1,6 @@ qq004.hs:8:21: - GHC stage restriction: parse - is used in a quasiquote, and must be imported, not defined locally + GHC stage restriction: + ‘parse’ is used in a top-level splice, quasi-quote, or annotation, + and must be imported, not defined locally + In the quasi-quotation: [parse||] diff --git a/testsuite/tests/th/T10047.hs b/testsuite/tests/th/T10047.hs new file mode 100644 index 0000000000..7916abbcf1 --- /dev/null +++ b/testsuite/tests/th/T10047.hs @@ -0,0 +1,6 @@ +module T10047 where + +import Language.Haskell.TH +import Language.Haskell.TH.Quote + +n = QuasiQuoter { quoteExp = dyn } diff --git a/testsuite/tests/th/T10047.script b/testsuite/tests/th/T10047.script new file mode 100644 index 0000000000..ee6d046456 --- /dev/null +++ b/testsuite/tests/th/T10047.script @@ -0,0 +1,4 @@ +:set -XTemplateHaskell -XQuasiQuotes +:l T10047 +:t [| $(dyn "foo") |] +:t [| [n|foo|] |] diff --git a/testsuite/tests/th/T10047.stdout b/testsuite/tests/th/T10047.stdout new file mode 100644 index 0000000000..ea22d78254 --- /dev/null +++ b/testsuite/tests/th/T10047.stdout @@ -0,0 +1,2 @@ +[| $(dyn "foo") |] :: ExpQ +[| [n|foo|] |] :: ExpQ diff --git a/testsuite/tests/th/T2597b.stderr b/testsuite/tests/th/T2597b.stderr index 99ff754ae1..0e897ccfcb 100644 --- a/testsuite/tests/th/T2597b.stderr +++ b/testsuite/tests/th/T2597b.stderr @@ -2,4 +2,4 @@ T2597b.hs:8:8: Empty stmt list in do-block When splicing a TH expression: do - In the splice: $mkBug2 + In the untyped splice: $mkBug2 diff --git a/testsuite/tests/th/T3177a.stderr b/testsuite/tests/th/T3177a.stderr index 88614ff3e8..d034e29430 100644 --- a/testsuite/tests/th/T3177a.stderr +++ b/testsuite/tests/th/T3177a.stderr @@ -1,5 +1,5 @@ -T3177a.hs:8:6: +T3177a.hs:8:8: ‘Int’ is applied to too many type arguments In the type signature for ‘f’: f :: Int Int diff --git a/testsuite/tests/th/T3395.stderr b/testsuite/tests/th/T3395.stderr index b3d9874a07..3c51176191 100644 --- a/testsuite/tests/th/T3395.stderr +++ b/testsuite/tests/th/T3395.stderr @@ -4,7 +4,7 @@ T3395.hs:6:9: r1 <- undefined (It should be an expression.) When splicing a TH expression: [r1 <- undefined | undefined] - In the splice: + In the untyped splice: $(return $ CompE [NoBindS (VarE $ mkName "undefined"), diff --git a/testsuite/tests/th/T5358.stderr b/testsuite/tests/th/T5358.stderr index 395510e43e..f47a9fd390 100644 --- a/testsuite/tests/th/T5358.stderr +++ b/testsuite/tests/th/T5358.stderr @@ -1,9 +1,9 @@ -T5358.hs:14:15: +T5358.hs:14:12: Exception when trying to run compile-time code: runTest called error: forall (t_0 :: *) . t_0 -> GHC.Types.Bool Code: do { VarI _ t _ _ <- reify (mkName "prop_x1"); ($) error ((++) "runTest called error: " pprint t) } - In the splice: + In the untyped splice: $(do { VarI _ t _ _ <- reify (mkName "prop_x1"); error $ ("runTest called error: " ++ pprint t) }) diff --git a/testsuite/tests/th/T5795.stderr b/testsuite/tests/th/T5795.stderr index bdc218c86c..79e9f92d17 100644 --- a/testsuite/tests/th/T5795.stderr +++ b/testsuite/tests/th/T5795.stderr @@ -1,6 +1,6 @@ T5795.hs:9:6: GHC stage restriction: - ‘ty’ is used in a top-level splice or annotation, + ‘ty’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally - In the splice: $ty + In the untyped splice: $ty diff --git a/testsuite/tests/th/T5971.stderr b/testsuite/tests/th/T5971.stderr index 07bae41015..d48c2255bd 100644 --- a/testsuite/tests/th/T5971.stderr +++ b/testsuite/tests/th/T5971.stderr @@ -4,4 +4,4 @@ T5971.hs:6:7: Probable cause: you used a unique Template Haskell name (NameU), perhaps via newName, but did not bind it If that's it, then -ddump-splices might be useful - In the splice: $(newName "x" >>= varE) + In the untyped splice: $(newName "x" >>= varE) diff --git a/testsuite/tests/th/T7276.stderr b/testsuite/tests/th/T7276.stderr index 8d6f545576..157d731c93 100644 --- a/testsuite/tests/th/T7276.stderr +++ b/testsuite/tests/th/T7276.stderr @@ -1,8 +1,8 @@ T7276.hs:6:8: Couldn't match type ‘[Language.Haskell.TH.Syntax.Dec]’ - with ‘Language.Haskell.TH.Syntax.Exp’ + with ‘Language.Haskell.TH.Syntax.Exp’ Expected type: Language.Haskell.TH.Lib.ExpQ Actual type: Language.Haskell.TH.Lib.DecsQ In the expression: [d| y = 3 |] - In the splice: $([d| y = 3 |]) + In the untyped splice: $([d| y = 3 |]) diff --git a/testsuite/tests/th/T7276a.stdout b/testsuite/tests/th/T7276a.stdout index 6ad7f98907..6aad44f6d5 100644 --- a/testsuite/tests/th/T7276a.stdout +++ b/testsuite/tests/th/T7276a.stdout @@ -16,4 +16,4 @@ In an equation for ‘x’: x = [d| a = () |] :: Q Exp (deferred type error) Code: x - In the splice: $x + In the untyped splice: $x diff --git a/testsuite/tests/th/T7667a.stderr b/testsuite/tests/th/T7667a.stderr index 1b54ed3c86..ca8b8f2145 100644 --- a/testsuite/tests/th/T7667a.stderr +++ b/testsuite/tests/th/T7667a.stderr @@ -2,4 +2,4 @@ T7667a.hs:8:12: Illegal variable name: ‘False’ When splicing a TH expression: False - In the splice: $(return $ VarE (mkName "False")) + In the untyped splice: $(return $ VarE (mkName "False")) diff --git a/testsuite/tests/th/T8412.stderr b/testsuite/tests/th/T8412.stderr index 64e2d41694..82b6116649 100644 --- a/testsuite/tests/th/T8412.stderr +++ b/testsuite/tests/th/T8412.stderr @@ -1,4 +1,4 @@ T8412.hs:5:12: Illegal literal in type (type literals must not be negative): -1 - In the splice: $(return $ LitT $ NumTyLit (- 1)) + In the untyped splice: $(return $ LitT $ NumTyLit (- 1)) diff --git a/testsuite/tests/th/TH_1tuple.stderr b/testsuite/tests/th/TH_1tuple.stderr index 4e1d38b879..5e9d6c799d 100644 --- a/testsuite/tests/th/TH_1tuple.stderr +++ b/testsuite/tests/th/TH_1tuple.stderr @@ -2,4 +2,4 @@ TH_1tuple.hs:11:7: Illegal 1-tuple type constructor When splicing a TH expression: 1 :: () - In the splice: $(sigE [| 1 |] (tupleT 1)) + In the untyped splice: $(sigE [| 1 |] (tupleT 1)) diff --git a/testsuite/tests/th/TH_StaticPointers02.stderr b/testsuite/tests/th/TH_StaticPointers02.stderr index 88da9d15e1..e6f6963434 100644 --- a/testsuite/tests/th/TH_StaticPointers02.stderr +++ b/testsuite/tests/th/TH_StaticPointers02.stderr @@ -1,10 +1,12 @@ TH_StaticPointers02.hs:11:34: static forms cannot be used in splices: static 'a' - In the splice: + In the untyped splice: $(case staticKey (static 'a') of { Fingerprint w0 w1 - -> let ... + -> let + w0i = ... + .... in [| fmap (\ p -> ...) $ unsafeLookupStaticPtr $ Fingerprint (fromIntegral w0i) (fromIntegral w1i) |] }) diff --git a/testsuite/tests/th/TH_runIO.stderr b/testsuite/tests/th/TH_runIO.stderr index 8173e8337c..5d5a4f2efc 100644 --- a/testsuite/tests/th/TH_runIO.stderr +++ b/testsuite/tests/th/TH_runIO.stderr @@ -1,6 +1,6 @@ -TH_runIO.hs:12:9: +TH_runIO.hs:12:7: Exception when trying to run compile-time code: user error (hi) Code: runIO (fail "hi") - In the splice: $(runIO (fail "hi")) + In the untyped splice: $(runIO (fail "hi")) diff --git a/testsuite/tests/th/TH_unresolvedInfix2.stderr b/testsuite/tests/th/TH_unresolvedInfix2.stderr index 57d93dc896..6e17ef474a 100644 --- a/testsuite/tests/th/TH_unresolvedInfix2.stderr +++ b/testsuite/tests/th/TH_unresolvedInfix2.stderr @@ -4,8 +4,8 @@ TH_unresolvedInfix2.hs:14:11: must have lower precedence than that of the operand, namely ‘:+’ [infixl 6] in the section: ‘:+ N :+ N’ - In the splice: + In the untyped splice: $(let - plus = conE ... - n = conE ... + plus = conE ':+ + n = conE 'N in infixE Nothing plus (Just $ uInfixE n plus n)) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 2b4c37a4af..e38c54a896 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -356,3 +356,4 @@ test('T9824', normal, compile, ['-v0']) test('T8031', normal, compile, ['-v0']) test('T8624', normal, run_command, ['$MAKE -s --no-print-directory T8624']) test('TH_Lift', normal, compile, ['-v0']) +test('T10047', normal, ghci_script, ['T10047.script']) |