diff gen/toir.cpp @ 1419:a6dfd3cb5b99 0.9.1

Error instead of assert on delegate literals as constant expressions. Make function literal linkage internal inside functions and external otherwise.
author Christian Kamm <kamm incasoftware de>
date Wed, 27 May 2009 19:20:18 +0200
parents e2cf1f67ca33
children 5d0c043ff131
line wrap: on
line diff
--- a/gen/toir.cpp	Mon May 25 12:50:40 2009 +0200
+++ b/gen/toir.cpp	Wed May 27 19:20:18 2009 +0200
@@ -2297,7 +2297,11 @@
     LOG_SCOPE;
 
     assert(fd);
-    assert(fd->tok == TOKfunction);
+    if (fd->tok != TOKfunction)
+    {
+        assert(fd->tok == TOKdelegate);
+        error("delegate literals as constant expressions are not yet allowed");
+    }
 
     fd->codegen(Type::sir);
     assert(fd->ir.irFunc->func);