Commit 9bf00304 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Fixed bug in missing type signatures check for ambiguous identifier

parent 4e12c0a6
...@@ -403,11 +403,9 @@ checkFieldExpression (Field _ _ e) = checkExpr e -- Hier auch "visitId ident" ? ...@@ -403,11 +403,9 @@ checkFieldExpression (Field _ _ e) = checkExpr e -- Hier auch "visitId ident" ?
-- Check for missing type signatures -- Check for missing type signatures
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- check if a type signature was specified for every top-level function -- |Check if every top-level function has an accompanying type signature.
-- declaration -- For external function declarations, this check is already performed
-- for external function declarations this check is already performed -- during syntax checking.
-- during syntax checking
checkMissingTypeSignatures :: [Decl] -> WCM () checkMissingTypeSignatures :: [Decl] -> WCM ()
checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do
let typedFs = [f | TypeSig _ fs _ <- decls, f <- fs] let typedFs = [f | TypeSig _ fs _ <- decls, f <- fs]
...@@ -419,8 +417,9 @@ checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do ...@@ -419,8 +417,9 @@ checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do
getTyScheme :: Ident -> WCM TypeScheme getTyScheme :: Ident -> WCM TypeScheme
getTyScheme q = do getTyScheme q = do
m <- getModuleIdent
tyEnv <- gets valueEnv tyEnv <- gets valueEnv
return $ case lookupValue q tyEnv of return $ case qualLookupValue (qualifyWith m q) tyEnv of
[Value _ _ tys] -> tys [Value _ _ tys] -> tys
_ -> internalError $ _ -> internalError $
"Checks.WarnCheck.getTyScheme: " ++ show q "Checks.WarnCheck.getTyScheme: " ++ show q
......
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