From 6f8471325431108b2f8c73b085bd586eaa33e4ff Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Sat, 22 Aug 2009 23:39:50 +0300 Subject: [PATCH] Die when root type is not specified --- src/GraphType.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GraphType.hs b/src/GraphType.hs index ba95dd2..e678656 100644 --- a/src/GraphType.hs +++ b/src/GraphType.hs @@ -111,7 +111,9 @@ addDecl declName clusters decls = do return ( danglingLinks, clusters' ) where -- Find declaration by name - Just d = findDecl declName decls + d = case findDecl declName decls of + Just x -> x + Nothing -> error $ "Could not find type " ++ declName ++ " in source files" -- Type, newtype or data declType = getDeclType d