Commit 6aff14f7 authored by Jan-Hendrik Matthes's avatar Jan-Hendrik Matthes 😄

Fix error when using class methods with additional type constraints

Fixes #46
parent 23e86daf
......@@ -134,4 +134,4 @@ normalize n ty = expandAliasType [TypeVariable (occur tv) | tv <- [0..]] ty
instanceType :: ExpandAliasType a => Type -> a -> a
instanceType ty = expandAliasType (ty : map TypeVariable [n..])
where
n = maximum (-1 : typeVars ty) + 1
n = maximum (1 : typeVars ty)
......@@ -146,6 +146,7 @@ passInfos = map mkPassTest
, "AnonymVar"
, "CaseComplete"
, "ChurchEncoding"
, "ClassMethods"
, "DefaultPrecedence"
, "Dequeue"
, "ExplicitLayout"
......
class A a where
funA :: Integral b => a -> b
instance A Float where
funA _ = error "fail"
class B a where
funB :: (Integral b, Show c) => a -> b -> c -> a
instance B Float where
funB x _ _ = x
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment