diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-22 11:17:44 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-22 11:17:44 +0000 |
commit | 484f8d35b7cb3f77d96f9f4ffc16bb8c946f47fd (patch) | |
tree | a9df192974016d8af111cfd77c96a64948bebe17 /testsuite/tests/ado | |
parent | b125392983401cc9fe13502e52880387bc71a092 (diff) | |
download | haskell-484f8d35b7cb3f77d96f9f4ffc16bb8c946f47fd.tar.gz |
Fix ApplicativeDo constraint scoping
This patch fixes Trac #13242, by a bit of fancy footwork
with the LIE variable in which the WantedConstraints are
collected.
I think it can be simplified further, using a 'map'.
Diffstat (limited to 'testsuite/tests/ado')
-rw-r--r-- | testsuite/tests/ado/T13242.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/ado/all.T | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/ado/T13242.hs b/testsuite/tests/ado/T13242.hs new file mode 100644 index 0000000000..ccaa93c087 --- /dev/null +++ b/testsuite/tests/ado/T13242.hs @@ -0,0 +1,16 @@ +-- Panic.hs +{-# LANGUAGE ApplicativeDo #-} +{-# LANGUAGE ExistentialQuantification #-} +module T13242 where + +import Data.STRef +import Control.Monad.ST + +data A = forall a. A a + +st :: ST s () +st = do + A _ <- pure $ A True + ref <- newSTRef 1 + readSTRef ref + pure () diff --git a/testsuite/tests/ado/all.T b/testsuite/tests/ado/all.T index 67697b93e4..6a1b4ec612 100644 --- a/testsuite/tests/ado/all.T +++ b/testsuite/tests/ado/all.T @@ -8,3 +8,4 @@ test('ado007', normal, compile, ['']) test('T11607', normal, compile_and_run, ['']) test('ado-optimal', normal, compile_and_run, ['']) test('T12490', normal, compile, ['']) +test('T13242', normal, compile, ['']) |