mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-29 16:50:19 +02:00
Error instead of assert on delegate literals as constant expressions.
Make function literal linkage internal inside functions and external otherwise.
This commit is contained in:
+5
-1
@@ -2297,7 +2297,11 @@ LLConstant* FuncExp::toConstElem(IRState* p)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user