summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/TcCustomSolverSuper.hs
blob: c401e1c4464dee872597ad5c1eafa1147d87c5f0 (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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
module TcCustomSolverSuper where

import GHC.TypeLits
import Data.Typeable

{-

When solving super-class instances, GHC solves the evidence without
using the solver (see `tcSuperClasses` in `TcInstDecls`).

However, some classes need to be excepted from this behavior,
as they have custom solving rules, and this test checks that
we got this right.
-}


class (Typeable x, KnownNat x)    => C x
class (Typeable x, KnownSymbol x) => D x

instance C 2
instance D "2"