git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #1664, check kind before expanding wildcards.
commit521d20e62a9dad7111e4774b6cfe04d86731add1 authorPhil Freeman <paf31@cantab.net> dateMon 23 Nov 2015, 17:06 (11 years ago) parenta824830
2 files changed+18−2
examples/passing/1664.purs+16 src/Language/PureScript/TypeChecker/Types.hs+2−2
examples/passing/1664.pursnew file+16
@@ -0,0 +1,16 @@
1+module Main where
2+
3+import Prelude
4+import Control.Monad.Eff
5+import Control.Monad.Eff.Console
6+
7+data Identity a = Identity a
8+
9+newtype IdentityEff e a = IdentityEff (Eff e (Identity a))
10+
11+test :: forall e a. IdentityEff e a -> IdentityEff e Unit
12+test (IdentityEff action) = IdentityEff $ do
13+ (Identity x :: Identity _) <- action
14+ return $ Identity unit
15+
16+main = log "Done"
src/Language/PureScript/TypeChecker/Types.hs+2−2
@@ -406,9 +406,9 @@ inferBinder val (PositionedBinder pos _ binder) =
406406-- change the definition of `binderRequiresMonotype`,
407407-- and use `kindOfWithScopedVars`.
408408inferBinder val (TypedBinder ty binder) = do
409+ kind <- kindOf ty
410+ checkTypeKind ty kind
409411 ty1 <- replaceAllTypeSynonyms <=< replaceTypeWildcards $ ty
410− kind <- kindOf ty1
411− checkTypeKind ty1 kind
412412 unifyTypes val ty1
413413 inferBinder val binder
414414