Skip to content

Commit

Permalink
Merge branch 'master' into 1846
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed Feb 6, 2016
2 parents 6566dd4 + 2380c68 commit 0dc8a34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ install:
- mkdir -p .cabal-sandbox
- cabal sandbox init --sandbox .cabal-sandbox
# Download stackage cabal.config, not sure whether filtering is necessary
- if [ -n "$STACKAGE" ]; then curl http://www.stackage.org/$STACKAGE/cabal.config | grep -v purescript > cabal.config; fi
- if [ -n "$STACKAGE" ]; then curl https://www.stackage.org/$STACKAGE/cabal.config | grep -v purescript > cabal.config; fi
- cabal install --only-dependencies --enable-tests
- cabal install hpc-coveralls
# Snapshot state of the sandbox now, so we don't need to make new one for test install
Expand Down
10 changes: 5 additions & 5 deletions src/Language/PureScript/TypeChecker.hs
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ typeCheckAll moduleName _ ds = traverse go ds <* traverse_ checkFixities ds
let args' = args `withKinds` kind
addTypeSynonym moduleName name args' ty kind
return $ TypeSynonymDeclaration name args ty
go (TypeDeclaration{}) = internalError "Type declarations should have been removed"
go TypeDeclaration{} = internalError "Type declarations should have been removed"
go (ValueDeclaration name nameKind [] (Right val)) =
warnAndRethrow (addHint (ErrorInValueDeclaration name)) $ do
valueIsNotDefined moduleName name
[(_, (val', ty))] <- typesOf moduleName [(name, val)]
addValue moduleName name ty nameKind
return $ ValueDeclaration name nameKind [] $ Right val'
go (ValueDeclaration{}) = internalError "Binders were not desugared"
go ValueDeclaration{} = internalError "Binders were not desugared"
go (BindingGroupDeclaration vals) =
warnAndRethrow (addHint (ErrorInBindingGroup (map (\(ident, _, _) -> ident) vals))) $ do
for_ (map (\(ident, _, _) -> ident) vals) $ \name ->
Expand All @@ -264,8 +264,8 @@ typeCheckAll moduleName _ ds = traverse go ds <* traverse_ checkFixities ds
Just _ -> throwError . errorMessage $ RedefinedIdent name
Nothing -> putEnv (env { names = M.insert (moduleName, name) (ty, External, Defined) (names env) })
return d
go (d@(FixityDeclaration{})) = return d
go (d@(ImportDeclaration{})) = return d
go (d@FixityDeclaration{}) = return d
go (d@ImportDeclaration{}) = return d
go (d@(TypeClassDeclaration pn args implies tys)) = do
addTypeClass moduleName pn args implies tys
return d
Expand Down Expand Up @@ -429,7 +429,7 @@ typeCheckModule (Module ss coms mn decls (Just exps)) = warnAndRethrow (addHint
checkNonAliasesAreExported dr@(ValueRef (Op name)) =
case listToMaybe (mapMaybe getAlias decls) of
Just alias ->
when (not $ any (== ValueRef alias) exps) $
unless (ValueRef alias `elem` exps) $
throwError . errorMessage $ TransitiveExportError dr [ValueRef alias]
_ -> return ()
where
Expand Down

0 comments on commit 0dc8a34

Please sign in to comment.