Fix typechecker bug with type synonyms in type annotations
commit18082c7e15bf721480777abb66ec96289fbc112e
authorPhil Freeman <paf31@cantab.net>
dateThu 13 Feb 2014, 10:29 (13 years ago)
parente384610
src/Language/PureScript/TypeChecker/Types.hs+2−1
@@ -843,7 +843,8 @@ check' (TypedValue checkType val ty1) ty2 = do
843843 Just moduleName <- checkCurrentModule <$> get
844844 kind <- liftCheck $ kindOf moduleName ty1
845845 guardWith ("Expected type of kind *, was " ++ prettyPrintKind kind) $ kind == Star
846− val' <- subsumes (Just val) ty1 ty2
846+ ty1' <- introduceSkolemScope <=< replaceAllTypeSynonyms $ ty1
847+ val' <- subsumes (Just val) ty1' ty2
847848 case val' of
848849 Nothing -> throwError "Unable to check type subsumption"
849850 Just val'' -> do