summaryrefslogtreecommitdiff
path: root/testsuite/tests/deSugar/should_run
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-02-18 11:05:45 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-02-18 11:35:06 +0000
commit01449eb552daa082e46ceaaf8481708ee73dc2ad (patch)
treee23a374134e33784f1707859190264b702ae0ad6 /testsuite/tests/deSugar/should_run
parent27842ec190cf46b6e494520761af41847837dc86 (diff)
downloadhaskell-01449eb552daa082e46ceaaf8481708ee73dc2ad.tar.gz
Fix desugaring of bang-pattern let-bindings
When implementing Strict Haskell, the patch 46a03fbe didn't faithfully implement the semantics given in the manual. In particular there was an ad-hoc case in mkSelectorBinds for "strict and no binders" that didn't work. This patch fixes it, curing Trac #11572. Howver it forced me to think about banged let-bindings, and I rather think we do not have quite the right semantics yet, so I've opened Trac #11601.
Diffstat (limited to 'testsuite/tests/deSugar/should_run')
-rw-r--r--testsuite/tests/deSugar/should_run/T11572.hs6
-rw-r--r--testsuite/tests/deSugar/should_run/T11572.stderr4
-rw-r--r--testsuite/tests/deSugar/should_run/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/T11572.hs b/testsuite/tests/deSugar/should_run/T11572.hs
new file mode 100644
index 0000000000..4972241e5b
--- /dev/null
+++ b/testsuite/tests/deSugar/should_run/T11572.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE BangPatterns #-}
+
+module Main where
+
+main :: IO ()
+main = let !_ = (undefined :: ()) in print 2
diff --git a/testsuite/tests/deSugar/should_run/T11572.stderr b/testsuite/tests/deSugar/should_run/T11572.stderr
new file mode 100644
index 0000000000..b1136024db
--- /dev/null
+++ b/testsuite/tests/deSugar/should_run/T11572.stderr
@@ -0,0 +1,4 @@
+T11572: Prelude.undefined
+CallStack (from HasCallStack):
+ error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
+ undefined, called at T11572.hs:6:18 in main:Main
diff --git a/testsuite/tests/deSugar/should_run/all.T b/testsuite/tests/deSugar/should_run/all.T
index 6bd054286b..265580ab0d 100644
--- a/testsuite/tests/deSugar/should_run/all.T
+++ b/testsuite/tests/deSugar/should_run/all.T
@@ -50,3 +50,4 @@ test('DsStrictData', normal, compile_and_run, [''])
test('DsStrict', normal, compile_and_run, [''])
test('DsStrictLet', normal, compile_and_run, ['-O'])
test('T11193', exit_code(1), compile_and_run, [''])
+test('T11572', exit_code(1), compile_and_run, [''])