summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc231.hs
blob: 8a655e1c0e59fa3bee2ed41e25bfc79194ffbd54 (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
31
32
33
34
{-# 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 s b chain. (Zork s (Z [Char]) b)
--         => Q s (Z [Char]) chain -> ST s ()

-- Note the quantification over 'b', which was previously
-- omitted; see Note [Important subtlety in oclose] in GHC.Tc.Instance.FunDeps
-- (Note removed in ecddaca17dccbe1d0b56220d838fce8bc4b97884, but you can
-- find it in the history)

-- June 2021: marking this test as should_fail again.
-- See https://gitlab.haskell.org/ghc/ghc/-/issues/20064

module ShouldCompile where

import GHC.ST

data Q s a chain = Node s a chain

data Z a = Z a

s :: Q s (Z [Char]) chain -> Q s (Z [Char]) chain
s = undefined

class  Zork s a b | a -> b where
  huh :: Q s a chain -> ST s ()

--foo :: Zork s (Z [Char]) b => Q s (Z [Char]) chain -> ST s ()
foo b = huh (s b)