testsuite: Assert that testsuite ways are known
[ghc.git] / testsuite / tests / typecheck / should_compile / T15232.hs
1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE UndecidableInstances #-}
4 {-# OPTIONS_GHC -Wredundant-constraints -Wall -Werror #-}
5 import GHC.TypeLits (TypeError, ErrorMessage(..))
6
7 class C a where f :: a -> a
8 instance {-# OVERLAPPING #-} C Int where f _ = 42
9 instance {-# OVERLAPPABLE #-} TypeError ( 'Text "Only Int is supported" ) => C a where f = undefined
10
11 main :: IO ()
12 main = print $ f (42::Int)