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

Cosmetics

parent ce2b3c4a
......@@ -134,7 +134,8 @@ expandTypeWith tc cs = do
[t] | isDataType t -> do mapM_ (checkConstr $ constrs t) nubCons
return [ExportTypeWith (origName t) nubCons]
| isRecordType t -> do mapM_ (checkLabel $ labels t) nubCons
return [ExportTypeWith (origName t) (map renameLabel nubCons)]
return [ExportTypeWith (origName t)
(map renameLabel nubCons)]
| otherwise -> report (errNonDataType tc) >> return []
_ -> report (errAmbiguousType tc) >> return []
where
......
......@@ -404,9 +404,9 @@ checkFieldExpression (Field _ _ e) = checkExpr e -- Hier auch "visitId ident" ?
-- For external function declarations, this check is already performed
-- during syntax checking.
checkMissingTypeSignatures :: [Decl] -> WCM ()
checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do
let typedFs = [f | TypeSig _ fs _ <- decls, f <- fs]
untypedFs = [f | FunctionDecl _ f _ <- decls, f `notElem` typedFs]
checkMissingTypeSignatures ds = warnFor WarnMissingSignatures $ do
let typedFs = [f | TypeSig _ fs _ <- ds, f <- fs]
untypedFs = [f | FunctionDecl _ f _ <- ds, f `notElem` typedFs]
unless (null untypedFs) $ do
mid <- getModuleIdent
tyScs <- mapM getTyScheme untypedFs
......@@ -701,7 +701,8 @@ getConTy q = do
[NewtypeConstructor _ (ForAllExist _ _ ty)] -> ty
_ -> case qualLookupTC q tcEnv of
[AliasType _ _ ty] -> ty
_ -> internalError $ "Checks.WarnCheck.getConTy: " ++ show q
_ -> internalError $
"Checks.WarnCheck.getConTy: " ++ show q
-- |Retrieve all constructors of a given type.
getTyCons :: QualIdent -> Type -> WCM [DataConstr]
......
......@@ -110,7 +110,7 @@ compileInterface ctxt (p, m) fn = do
Just src -> case runCYM (parseInterface fn src) of
Left err -> report err
Right intf@(Interface n is _) ->
if (m /= n)
if m /= n
then report [errWrongInterface (first fn) m n]
else do
let (intf', intfErrs) = intfSyntaxCheck intf
......
......@@ -12,6 +12,8 @@ full = { intField := 1, boolField := True }
expr = empty :> intField + 1 == 0
match { intField = i | _ } = i
-- int :: { intField :: Int | a }
-- int = { intField := 0 }
......@@ -20,4 +22,4 @@ type Record2 =
, boolField2 :: Bool
}
test = { intField := 0, boolField2 := True }
test = { intField2 := 0, boolField2 := True }
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