shithub: mc

Download patch

ref: 63398e32ed2d5b8e75e26caff58e16646668733f
parent: bbe432bb785e1c3085e17402480a86cd6759820c
author: Ori Bernstein <[email protected]>
date: Thu Jun 21 18:33:37 EDT 2012

Don't try to bind non-generics.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -633,8 +633,9 @@
             break;
         case Nfunc:
             setsuper(n->func.scope, curstab());
-            for (i = 0; i < n->func.nargs; i++)
-                tybind(tybindings[ntybindings - 1], n->func.args[i]->decl.type);
+            if (ntybindings > 0)
+                for (i = 0; i < n->func.nargs; i++)
+                    tybind(tybindings[ntybindings - 1], n->func.args[i]->decl.type);
             pushstab(n->func.scope);
             inferstab(n->block.scope);
             inferfunc(n);