Commit c0a5efbc authored by Finn Teegen's avatar Finn Teegen
Browse files

Merge branch 'duplicate_top_pattern' into 'master'

Remove duplicate warnings for top-level patterns

Closes #25

See merge request !6
parents 08178717 da18e522
......@@ -569,12 +569,8 @@ checkEquationsLhs p [Equation p' lhs rhs] = do
lhs' <- checkEqLhs p' lhs
case lhs' of
Left l -> return $ funDecl' l
Right r -> patDecl' r >>= checkDeclLhs
Right r -> checkDeclLhs (PatternDecl p' r rhs)
where funDecl' (f, lhs') = FunctionDecl p () f [Equation p' lhs' rhs]
patDecl' t = do
k <- getScopeId
when (k == globalScopeId) $ report $ errToplevelPattern p
return $ PatternDecl p' t rhs
checkEquationsLhs _ _ = internalError "SyntaxCheck.checkEquationsLhs"
checkEqLhs :: Position -> Lhs () -> SCM (Either (Ident, Lhs ()) (Pattern ()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment