Commit 83a952d1 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #12845

parent f0f46826
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module T12845 where
import Data.Proxy
data Foo (m :: Bool)
type family Head (xs :: [(Bool, Bool)]) where Head (x ': xs) = x
type family Bar (x :: Bool) (y :: Bool) :: Bool
-- to trigger the bug, r and r' cannot *both* appear on the RHS
broken :: forall r r' rngs . ('(r,r') ~ Head rngs, Bar r r' ~ 'True, _)
=> Foo r -> Proxy rngs -> ()
broken x _ = let y = requireBar x :: Foo r' in ()
requireBar :: (Bar m m' ~ 'True) => Foo m -> Foo m'
requireBar = undefined
T12845.hs:18:70: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘() :: Constraint’
• In the type signature:
broken :: forall r r' rngs.
('(r, r') ~ Head rngs, Bar r r' ~ True, _) =>
Foo r -> Proxy rngs -> ()
......@@ -67,3 +67,4 @@ test('T11339a', normal, compile, [''])
test('T11670', normal, compile, [''])
test('T12156', normal, compile_fail, ['-fdefer-typed-holes'])
test('T12531', normal, compile, ['-fdefer-typed-holes'])
test('T12845', normal, compile, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment