diff --git a/testsuite/tests/th/T5358.hs b/testsuite/tests/th/T5358.hs new file mode 100644 index 0000000000000000000000000000000000000000..39dec37faf2f5c22531a27210e2b831957b3a119 --- /dev/null +++ b/testsuite/tests/th/T5358.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TemplateHaskell #-} +module T5358 where + +import Language.Haskell.TH + +t1, t2 :: Int +t1 x = x +t2 x = x + +prop_x1 x = t1 x == t2 x + +runTests = \$( do VarI _ t _ _ <- reify (mkName "prop_x1") + error \$ pprint t + ) diff --git a/testsuite/tests/th/T5358.stderr b/testsuite/tests/th/T5358.stderr new file mode 100644 index 0000000000000000000000000000000000000000..4a1bfbd5fe432d7cbc9c6411a2c51e3738ed850e --- /dev/null +++ b/testsuite/tests/th/T5358.stderr @@ -0,0 +1,15 @@ + +T5358.hs:7:1: + The equation(s) for `t1' have one argument, + but its type `Int' has none + +T5358.hs:8:1: + The equation(s) for `t2' have one argument, + but its type `Int' has none + +T5358.hs:10:13: + 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 + In an equation for `prop_x1': prop_x1 x = t1 x == t2 x diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index c3a6802e1275bb628d595c190f3e8347d4e27a05..17d30ff58b94eae9fe5bb6ccfdb29e65e7989b74 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -192,3 +192,5 @@ test('TH_unresolvedInfix2', normal, compile_fail, ['-v0']) + +test('T5358', normal, compile_fail, [''])