diff options
author | Geoffrey Mainland <mainland@apeiron.net> | 2013-05-16 15:08:07 +0100 |
---|---|---|
committer | Geoffrey Mainland <mainland@apeiron.net> | 2013-10-04 14:58:40 -0400 |
commit | 1d43475bc175c2ec6df5c6b71832ffa7d1ee002b (patch) | |
tree | 68eb1c0d1a9467d06ec6f41e9b9b92f8712952b4 /testsuite | |
parent | 4ccdc324530d51caad2098774e741b6c8c4dd74f (diff) | |
download | haskell-1d43475bc175c2ec6df5c6b71832ffa7d1ee002b.tar.gz |
Fix test wibbles for new Template Haskell.
Because splices are now run in the renamer, we do not get the same error context
as we would when running in the type checker. In most cases we get less context,
and in some cases I have added additional context. Error messages should at
least tell the user that an error occurred in a splice; dropping context beyond
that point is not judged a great loss.
Note that we may now report only one error when multiple errors were reported
before because splices are now run in the renamer.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/ghci/scripts/T4127a.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T2222.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/th/T2597b.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/T3177a.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T3395.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T5358.stderr | 36 | ||||
-rw-r--r-- | testsuite/tests/th/T5795.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/T5971.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/T6114.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/th/TH_1tuple.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/TH_dataD1.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/th/TH_runIO.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/th/TH_unresolvedInfix2.stderr | 8 |
13 files changed, 13 insertions, 63 deletions
diff --git a/testsuite/tests/ghci/scripts/T4127a.stderr b/testsuite/tests/ghci/scripts/T4127a.stderr index cc118a9e20..598bdbc5a3 100644 --- a/testsuite/tests/ghci/scripts/T4127a.stderr +++ b/testsuite/tests/ghci/scripts/T4127a.stderr @@ -3,3 +3,9 @@ Multiple declarations of ‛f’ Declared at: <interactive>:3:32 <interactive>:3:68 + In the Template Haskell quotation + [d| f = undefined + class Foo x where + f :: x -> x + instance Foo Int where + f = id |] diff --git a/testsuite/tests/th/T2222.stderr b/testsuite/tests/th/T2222.stderr index 7d90eb3e94..b0a7e9f799 100644 --- a/testsuite/tests/th/T2222.stderr +++ b/testsuite/tests/th/T2222.stderr @@ -1,5 +1,5 @@ -inside d: t_0 inside b: a_0 +inside d: GHC.Types.Bool type of c: GHC.Types.Bool inside f: GHC.Types.Bool type of e: GHC.Types.Bool diff --git a/testsuite/tests/th/T2597b.stderr b/testsuite/tests/th/T2597b.stderr index a9295ebd5f..7d0a207e3a 100644 --- a/testsuite/tests/th/T2597b.stderr +++ b/testsuite/tests/th/T2597b.stderr @@ -3,4 +3,3 @@ T2597b.hs:8:8: Empty stmt list in do-block When splicing a TH expression: do In the expression: $mkBug2 - In an equation for ‛bug2’: bug2 = $mkBug2 diff --git a/testsuite/tests/th/T3177a.stderr b/testsuite/tests/th/T3177a.stderr index 4e9d4dd8fa..94d4f2e2d1 100644 --- a/testsuite/tests/th/T3177a.stderr +++ b/testsuite/tests/th/T3177a.stderr @@ -1,9 +1,7 @@ -T3177a.hs:8:15: +T3177a.hs:8:6: ‛Int’ is applied to too many type arguments - In the type ‛Int Int’ - In the Template Haskell quotation [t| Int Int |] - In the first argument of ‛id’, namely ‛[t| Int Int |]’ + In the type signature for ‛f’: f :: Int Int T3177a.hs:11:6: ‛Int’ is applied to too many type arguments diff --git a/testsuite/tests/th/T3395.stderr b/testsuite/tests/th/T3395.stderr index cd25afe039..31a0623233 100644 --- a/testsuite/tests/th/T3395.stderr +++ b/testsuite/tests/th/T3395.stderr @@ -9,9 +9,3 @@ T3395.hs:6:9: $ CompE [NoBindS (VarE $ mkName "undefined"), BindS (VarP $ mkName "r1") (VarE $ mkName "undefined")]) - In an equation for ‛foo’: - foo - = $(return - $ CompE - [NoBindS (VarE $ mkName "undefined"), - BindS (VarP $ mkName "r1") (VarE $ mkName "undefined")]) diff --git a/testsuite/tests/th/T5358.stderr b/testsuite/tests/th/T5358.stderr index 87f81d1137..cab4b97536 100644 --- a/testsuite/tests/th/T5358.stderr +++ b/testsuite/tests/th/T5358.stderr @@ -1,35 +1,5 @@ -T5358.hs:7:1: - Couldn't match expected type ‛t1 -> t1’ with actual type ‛Int’ - The equation(s) for ‛t1’ have one argument, - but its type ‛Int’ has none - -T5358.hs:8:1: - Couldn't match expected type ‛t0 -> t0’ with actual type ‛Int’ - The equation(s) for ‛t2’ have one argument, - but its type ‛Int’ has none - -T5358.hs:10:13: - Couldn't match expected type ‛t -> a0’ with actual type ‛Int’ - Relevant bindings include - x :: t (bound at T5358.hs:10:9) - prop_x1 :: t -> Bool (bound at T5358.hs:10:1) - The function ‛t1’ is applied to one argument, - but its type ‛Int’ has none - In the first argument of ‛(==)’, namely ‛t1 x’ - In the expression: t1 x == t2 x - -T5358.hs:10:21: - Couldn't match expected type ‛t -> a0’ with actual type ‛Int’ - Relevant bindings include - x :: t (bound at T5358.hs:10:9) - prop_x1 :: t -> Bool (bound at T5358.hs:10:1) - The function ‛t2’ is applied to one argument, - but its type ‛Int’ has none - In the second argument of ‛(==)’, namely ‛t2 x’ - In the expression: t1 x == t2 x - -T5358.hs:12:15: +T5358.hs:14:15: 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"); @@ -37,7 +7,3 @@ T5358.hs:12:15: In the expression: $(do { VarI _ t _ _ <- reify (mkName "prop_x1"); error $ ("runTest called error: " ++ pprint t) }) - In an equation for ‛runTests’: - runTests - = $(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 74d6c34941..dd909f14ee 100644 --- a/testsuite/tests/th/T5795.stderr +++ b/testsuite/tests/th/T5795.stderr @@ -4,4 +4,3 @@ T5795.hs:9:6: ‛ty’ is used in a top-level splice or annotation, and must be imported, not defined locally In the expression: ty - In the type signature for ‛f’: f :: $ty diff --git a/testsuite/tests/th/T5971.stderr b/testsuite/tests/th/T5971.stderr index 9f3f993813..16eb00a051 100644 --- a/testsuite/tests/th/T5971.stderr +++ b/testsuite/tests/th/T5971.stderr @@ -8,4 +8,3 @@ T5971.hs:6:7: $(newName "x" >>= varE) To see what the splice expanded to, use -ddump-splices In the expression: $(newName "x" >>= varE) - In a pattern binding: _ = $(newName "x" >>= varE) diff --git a/testsuite/tests/th/T6114.stderr b/testsuite/tests/th/T6114.stderr index e588ada7f3..ff93cb2d7a 100644 --- a/testsuite/tests/th/T6114.stderr +++ b/testsuite/tests/th/T6114.stderr @@ -10,8 +10,3 @@ T6114.hs:6:17: instanceType <- [t| $(varT xName) |]; _ <- reifyInstances ''Eq [instanceType]; .... }) - In an equation for ‛instanceVar’: - instanceVar - = $(do { xName <- newName "x"; - instanceType <- [t| $(varT xName) |]; - .... }) diff --git a/testsuite/tests/th/TH_1tuple.stderr b/testsuite/tests/th/TH_1tuple.stderr index 309bde5ebf..cd6aaca8cd 100644 --- a/testsuite/tests/th/TH_1tuple.stderr +++ b/testsuite/tests/th/TH_1tuple.stderr @@ -3,4 +3,3 @@ TH_1tuple.hs:11:7: Illegal 1-tuple type constructor When splicing a TH expression: 1 :: () In the expression: $(sigE [| 1 |] (tupleT 1)) - In an equation for ‛y’: y = $(sigE [| 1 |] (tupleT 1)) diff --git a/testsuite/tests/th/TH_dataD1.stderr b/testsuite/tests/th/TH_dataD1.stderr index ddabee742a..6c1ea38cb2 100644 --- a/testsuite/tests/th/TH_dataD1.stderr +++ b/testsuite/tests/th/TH_dataD1.stderr @@ -1,3 +1,5 @@ TH_dataD1.hs:8:13: Declaration splices are not permitted inside declaration brackets + In the Template Haskell quotation + [d| $(dataD [] (mkName "D") [] [normalC "K" []] []) |] diff --git a/testsuite/tests/th/TH_runIO.stderr b/testsuite/tests/th/TH_runIO.stderr index 6d7499a3da..14c3ec8144 100644 --- a/testsuite/tests/th/TH_runIO.stderr +++ b/testsuite/tests/th/TH_runIO.stderr @@ -4,4 +4,3 @@ TH_runIO.hs:12:9: user error (hi) Code: runIO (fail "hi") In the expression: $(runIO (fail "hi")) - In an equation for ‛foo’: foo = $(runIO (fail "hi")) diff --git a/testsuite/tests/th/TH_unresolvedInfix2.stderr b/testsuite/tests/th/TH_unresolvedInfix2.stderr index fab508a331..31f06058da 100644 --- a/testsuite/tests/th/TH_unresolvedInfix2.stderr +++ b/testsuite/tests/th/TH_unresolvedInfix2.stderr @@ -1,5 +1,5 @@ -TH_unresolvedInfix2.hs:12:11: +TH_unresolvedInfix2.hs:14:11: The operator ‛:+’ [infixl 6] of a section must have lower precedence than that of the operand, namely ‛:+’ [infixl 6] @@ -15,9 +15,3 @@ TH_unresolvedInfix2.hs:12:11: 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)) |