shithub: mc

Download patch

ref: dcccec157840ef6fd894712427f16560e5b128da
parent: 446007ccd8a57d18b123b857bf4801d956cf0abd
author: Ori Bernstein <[email protected]>
date: Sat Sep 6 18:09:54 EDT 2014

Allow traits to work.

    They don't implement their functions either.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -962,8 +962,9 @@
                 fatal(nx->line, "Export %s defined with different genericness on line %d", ctxstr(st, nx), ng->line);
             unify(st, nx, type(st, ng), type(st, nx));
         } else {
-            if (!nx->decl.isextern && !nx->decl.isimport && !nx->decl.init && (nx->decl.isconst || nx->decl.isgeneric))
-                fatal(nx->line, "Export %s defined but not implemented", ctxstr(st, nx));
+            if (!nx->decl.isextern && !nx->decl.isimport && !nx->decl.trait)
+                if (!nx->decl.init && (nx->decl.isconst || nx->decl.isgeneric))
+                    fatal(nx->line, "Export %s defined but not implemented", ctxstr(st, nx));
             putdcl(globls, nx);
         }
     }