summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_fail/T13233_elab.hs
blob: 96adc5ff9ae7e3233b0d32c35e9245342b940113 (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
-- Same as T13233, but we compile with -fprint-typechecker-elaboration.
-- The error message should show an eta-expanded call to (#,#).
-- See comments at https://gitlab.haskell.org/ghc/ghc/merge_requests/2540
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MagicHash #-}
module Bug where

import GHC.Exts ( TYPE, RuntimeRep )

class Foo (a :: TYPE rep) where
  bar :: forall rep2 (b :: TYPE rep2). (a -> a -> b) -> a -> a -> b

baz :: forall rep (a :: TYPE rep). Foo a => a -> a -> (# a, a #)
baz = bar (#,#)

obscure :: (forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep)
                   (a :: TYPE rep1) (b :: TYPE rep2).
                   a -> b -> (# a, b #)) -> ()
obscure _ = ()

quux :: ()
quux = obscure (#,#)