summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent/should_fail/T14066d.hs
blob: ea4764468804cd76ed83007850e0e4c6fb64e20a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE RankNTypes, ScopedTypeVariables, TypeInType #-}

module T14066d where

import Data.Proxy

g :: (forall c b (a :: c). (Proxy a, Proxy c, b)) -> ()
g _ = ()

f :: forall b. b -> (Proxy Maybe, ())
f x = (fstOf3 y :: Proxy Maybe, g y)
  where
    y :: (Proxy a, Proxy c, b)  -- this should NOT generalize over b
                                -- meaning the call to g is ill-typed
    y = (Proxy, Proxy, x)

fstOf3 (x, _, _) = x