summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-05-09 09:29:44 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-05-09 10:44:01 +0100
commit43a31683acbe2f8120fbb73fe5a6fd1f5de9db80 (patch)
tree0ac2b20c387a32dabe17bb20da25cb78a9e03d1d /testsuite/tests
parentcb5ca5f39c2ad26608516ee4248b9ddea31a1d5a (diff)
downloadhaskell-43a31683acbe2f8120fbb73fe5a6fd1f5de9db80.tar.gz
Reset cc_pend_sc flag in dropDerivedCt
I'd forgotten to reset this flag to True when dropping Derived constraints, which led to Trac #13662. Easily fixed.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T13662.hs25
-rw-r--r--testsuite/tests/indexed-types/should_compile/all.T1
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T13662.hs b/testsuite/tests/indexed-types/should_compile/T13662.hs
new file mode 100644
index 0000000000..5898f25d12
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T13662.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+module T13662 (run) where
+
+newtype Value a = Value a
+
+type family Repr (f :: * -> *) a :: *
+type instance Repr f Int = f Int
+
+class (Repr Value i ~ Value ir) => Native i ir where
+
+instance Native Int Int where
+
+
+fromInt :: (Native i ir) => i -> a
+fromInt = undefined
+
+apply :: (Int -> a -> a) -> a -> a
+apply weight = id
+
+run :: Float -> Float
+run =
+ let weight = \clip v -> fromInt clip * v
+ in apply weight
+
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 529f7defda..00d40ce2ac 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -263,3 +263,4 @@ test('T12538', normal, compile_fail, [''])
test('T13244', normal, compile, [''])
test('T13398a', normal, compile, [''])
test('T13398b', normal, compile, [''])
+test('T13662', normal, compile, [''])