summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail211.hs
blob: 18fe8c6dd89b963919378555a8a1a1e545a484d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE ImplicitParams, FlexibleContexts #-}

module ShouldFail where

class (?imp :: Int) => D t where
    methodD :: t -> t

instance (?imp :: Int) => D Int where
    methodD x = x + ?imp

test :: D Int => Int -- Requires FlexibleContexts
test = methodD ?imp

-- Should get reasonable error about unbound ?imp
use :: IO ()
use = print test