git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1551
commit85c07370e6c878e5119490a06a6a5e4de6e4b208 authorPhil Freeman <paf31@cantab.net> dateFri 23 Oct 2015, 14:33 (11 years ago) parent3794bda
2 files changed+9−2
examples/passing/TypedBinders.purs+6−1 src/Language/PureScript/TypeChecker/Types.hs+3−1
examples/passing/TypedBinders.purs+6−1
@@ -54,9 +54,14 @@ test3 n = case n of
5454test4 :: Tuple Int Int -> Tuple Int Int
5555test4 = (\(Tuple a b :: Tuple Int Int) -> Tuple b a)
5656
57+type Int1 = Int
58+
59+test5 :: Int1 -> Int1
60+test5 = \(x :: Int1) -> x
61+
5762main = do
5863 let t1 = test
5964 t2 = test2 id
6065 t3 = test3 1
6166 t4 = test4 (Tuple 1 0)
62− Control.Monad.Eff.Console.log "Done"
67+ Control.Monad.Eff.Console.log "Done"
src/Language/PureScript/TypeChecker/Types.hs+3−1
@@ -372,7 +372,9 @@ inferBinder val (PositionedBinder pos _ binder) =
372372 warnAndRethrowWithPosition pos $ inferBinder val binder
373373-- TODO: When adding support for polymorphic types, check subsumption here
374374-- and change the definition of `binderRequiresMonotype`
375−inferBinder val (TypedBinder ty binder) = val =?= ty >> inferBinder val binder
375+inferBinder val (TypedBinder ty binder) = do
376+ ty' <- replaceAllTypeSynonyms ty
377+ val =?= ty' >> inferBinder val binder
376378
377379-- | Returns true if a binder requires its argument type to be a monotype.
378380-- | If this is the case, we need to instantiate any polymorphic types before checking binders.