methodlookup: unique identifier for methods are name+signature
[mate.git] / Mate.hs
diff --git a/Mate.hs b/Mate.hs
index a4e2a97c258b0e8d687db652da39b49fd6b5a9f1..1c229e3cc560e8ddb1d2583febaa18b6eaf8c8c7 100644 (file)
--- a/Mate.hs
+++ b/Mate.hs
@@ -61,14 +61,13 @@ parseArgs _ _ = parseArgs ["-"] False
 
 executeMain :: B.ByteString -> Class Direct -> IO ()
 executeMain bclspath cls = do
-  hmap <- parseMethod cls "main"
-  case hmap of
-    Just hmap' -> do
-      let methods = classMethods cls; methods :: [Method Direct]
-      let method = find (\x -> methodName x == "main") methods
-      case method of
-        Just m -> do
-          let mi = MethodInfo "main" bclspath $ methodSignature m
+  let methods = classMethods cls; methods :: [Method Direct]
+  case find (\x -> methodName x == "main") methods of
+    Just m -> do
+      let mi = MethodInfo "main" bclspath $ methodSignature m
+      hmap <- parseMethod cls "main" $ methodSignature m
+      case hmap of
+        Just hmap' -> do
           entry <- compileBB hmap' mi
           addMethodRef entry mi [bclspath]
 #ifdef DEBUG