git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Another small corner case of #390
commit23c679f726e5c43559a94be6186ad2504e945bc0 authorPhil Freeman <paf31@cantab.net> dateSun 27 Apr 2014, 10:29 (13 years ago) parent0183452
2 files changed+13
examples/passing/UnknownInTypeClassLookup.purs+12 src/Language/PureScript/TypeChecker/Types.hs+1
examples/passing/UnknownInTypeClassLookup.pursnew file+12
@@ -0,0 +1,12 @@
1+module Main where
2+
3+class EQ a b
4+
5+instance eqAA :: EQ a a
6+
7+test :: forall a b. (EQ a b) => a -> b -> String
8+test _ _ = "Done"
9+
10+runTest a = test a a
11+
12+main = Debug.Trace.trace $ runTest 0
src/Language/PureScript/TypeChecker/Types.hs+1
@@ -421,6 +421,7 @@ pairwise p (x : xs) = all (p x) xs && pairwise p xs
421421-- Check that two types unify
422422--
423423unifiesWith :: Environment -> Type -> Type -> Bool
424+unifiesWith _ (TUnknown u1) (TUnknown u2) | u1 == u2 = True
424425unifiesWith _ (Skolem _ s1 _) (Skolem _ s2 _) | s1 == s2 = True
425426unifiesWith _ (TypeVar v1) (TypeVar v2) | v1 == v2 = True
426427unifiesWith _ (TypeConstructor c1) (TypeConstructor c2) | c1 == c2 = True