ref: b0b92f615f83d31f860044862592ea22cf925aaa
parent: 9a8ac636f97d0da01fe0d7283082bc7b9315e44e
author: Ori Bernstein <[email protected]>
date: Fri Oct 18 12:50:25 EDT 2013
Improved error checking. We now verify that the declaration and definition of exported variables have the same genericness.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -761,6 +761,8 @@
* body */
if (nx->decl.init && ng)
fatal(nx->line, "Export %s double-defined on line %d", ctxstr(st, nx), ng->line);
+ if (ng && nx->decl.isgeneric != ng->decl.isgeneric)
+ fatal(nx->line, "Export %s defined with different genericness on line %d", ctxstr(st, nx), ng->line);
if (!ng)
putdcl(globls, nx);
else