From fa3fb70d796ce3c17a84b7b9ed3a7ce9531a82d7 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 5 Aug 2011 16:28:57 +0100 Subject: Test Trac #5379 --- testsuite/tests/th/T5379.hs | 11 +++++++++++ testsuite/tests/th/T5379.stdout | 1 + testsuite/tests/th/all.T | 1 + 3 files changed, 13 insertions(+) create mode 100644 testsuite/tests/th/T5379.hs create mode 100644 testsuite/tests/th/T5379.stdout (limited to 'testsuite/tests/th') diff --git a/testsuite/tests/th/T5379.hs b/testsuite/tests/th/T5379.hs new file mode 100644 index 0000000000..d978032534 --- /dev/null +++ b/testsuite/tests/th/T5379.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TemplateHaskell #-} +module Main where + +import Language.Haskell.TH + +$( [d| g = 0 + h = $( return $ LamE [VarP (mkName "g")] (VarE 'g) ) |] ) + -- The 'g should bind to the g=0 definition + +-- Should print 0, not 1! +main = print (h 1) diff --git a/testsuite/tests/th/T5379.stdout b/testsuite/tests/th/T5379.stdout new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/testsuite/tests/th/T5379.stdout @@ -0,0 +1 @@ +0 diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index f2abff4e3d..f69a9ab9dd 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -195,3 +195,4 @@ test('TH_unresolvedInfix2', ['-v0']) test('T5358', normal, compile_fail, ['']) +test('T5379', normal, compile_and_run, ['']) -- cgit v1.2.1