git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #292
88cdb9aPhil Freeman
examples/passing/CheckSynonymBug.pursnew file+11
@@ -0,0 +1,11 @@
1+module Foo where
2+
3+ import Prelude
4+
5+ type Foo a = [a]
6+
7+ foo _ = Data.Array.length ([] :: Foo Number)
8+
9+module Main where
10+
11+main = Debug.Trace.trace "Done"
src/Language/PureScript/TypeChecker/Types.hs+1−1
@@ -746,7 +746,7 @@ check' (TypedValue checkType val ty1) ty2 = do
746 case val' of
746 case val' of
747 Nothing -> throwError "Unable to check type subsumption"
747 Nothing -> throwError "Unable to check type subsumption"
748 Just val'' -> do
748 Just val'' -> do
749− val''' <- if checkType then check val'' ty1 else return val''
749+ val''' <- if checkType then check val'' ty1' else return val''
750 return $ TypedValue checkType (TypedValue True val''' ty1) ty2
750 return $ TypedValue checkType (TypedValue True val''' ty1) ty2
751check' (Case vals binders) ret = do
751check' (Case vals binders) ret = do
752 vals' <- mapM infer vals
752 vals' <- mapM infer vals