git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1310
commit866651305b1559fd98a9b733d2d4d69e8ddd754d authorPhil Freeman <paf31@cantab.net> dateSat 12 Sep 2015, 11:46 (11 years ago) parentb0438dc
2 files changed+21−2
examples/failing/1310.purs+18 src/Language/PureScript/TypeChecker/Unify.hs+3−2
examples/failing/1310.pursnew file+18
@@ -0,0 +1,18 @@
1+-- @shouldFailWith NoInstanceFound
2+
3+module Issue1310 where
4+
5+import Prelude
6+import Control.Monad.Eff
7+import Control.Monad.Eff.Console
8+
9+class Inject f g where
10+ inj :: forall a. f a -> g a
11+
12+instance inject :: Inject f f where
13+ inj x = x
14+
15+foreign import data Oops :: !
16+
17+main :: forall eff. Eff (oops :: Oops | eff) Unit
18+main = inj (log "Oops")
src/Language/PureScript/TypeChecker/Unify.hs+3−2
@@ -169,8 +169,9 @@ unifiesWith e r1@(RCons _ _ _) r2@(RCons _ _ _) =
169169 go [] REmpty [] REmpty = True
170170 go [] (TypeVar v1) [] (TypeVar v2) = v1 == v2
171171 go [] (Skolem _ s1 _) [] (Skolem _ s2 _) = s1 == s2
172− go _ (TUnknown _) _ _ = True
173− go _ _ _ (TUnknown _) = True
172+ go [] (TUnknown _) _ _ = True
173+ go _ _ [] (TUnknown _) = True
174+ go _ (TUnknown _) _ (TUnknown _) = True
174175 go _ _ _ _ = False
175176unifiesWith _ _ _ = False
176177