blob: 9e91be3a6abf138ff41acce50f4a2affad28f982 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{-# LANGUAGE Haskell2010 #-}
{-# OPTIONS_GHC -ddump-types -dsuppress-module-prefixes #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts #-}
-- See #1456
-- The key thing here is that foo should get the type
-- foo :: forall b s t1. (Zork s (Z [Char]) b)
-- => Q s (Z [Char]) t1 -> ST s ()
-- Note the quantification over 'b', which was previously
-- omitted; see Note [Important subtlety in oclose] in GHC.Tc.Instance.FunDeps
module ShouldCompile where
import GHC.ST
data Q s a chain = Node s a chain
data Z a = Z a
s :: Q t (Z [Char]) t1 -> Q t (Z [Char]) t1
s = undefined
class Zork s a b | a -> b where
huh :: Q s a chain -> ST s ()
foo b = huh (s b)
|