summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T4284.hs
blob: 5e1b9ceb5f12f5b04f46c60db0ee666d70f1f891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE RankNTypes #-}
module Test where

foo :: () -> forall b. b
foo x = undefined

works = id (\x -> foo x)

fails = (id) (\x -> foo x)

-- works type checks, but fails fails with the following error
-- message:
--
--   Cannot match a monotype with `() -> forall b. b'
--   Probable cause: `foo' is applied to too few arguments
--   In the first argument of `(id)', namely `foo'
--   In the expression: (id) foo