shithub: mc

Download patch

ref: 4f1a566d65a2a1c91c18dbd96f5cba69b80d8008
parent: 86f01268aef860fafca5e93913e657efc58b240e
author: Ori Bernstein <[email protected]>
date: Fri Jun 29 09:13:49 EDT 2012

Try to unify pattern types.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -687,8 +687,10 @@
             break;
         case Nmatchstmt:
             infernode(n->matchstmt.val, NULL, sawret);
-            for (i = 0; i < n->matchstmt.nmatches; i++)
+            for (i = 0; i < n->matchstmt.nmatches; i++) {
                 infernode(n->matchstmt.matches[i], ret, sawret);
+                unify(n, type(n->matchstmt.val), type(n->matchstmt.matches[i]->match.pat));
+            }
             break;
         case Nmatch:
             infernode(n->match.pat, NULL, sawret);