# HG changeset patch # User Christian Kamm # Date 1217328554 -7200 # Node ID e763821ab244d80544d3e74d7ea47e90706157d8 # Parent 944d43f3779fe54de7e91f83d15cf699635bb863 Disallow delegates to static functions. diff -r 944d43f3779f -r e763821ab244 gen/toir.cpp --- a/gen/toir.cpp Tue Jul 29 12:44:28 2008 +0200 +++ b/gen/toir.cpp Tue Jul 29 12:49:14 2008 +0200 @@ -1828,6 +1828,9 @@ Logger::print("DelegateExp::toElem: %s | %s\n", toChars(), type->toChars()); LOG_SCOPE; + if(func->isStatic()) + error("can't take delegate of static function %s, it does not require a context ptr", func->toChars()); + const LLPointerType* int8ptrty = getPtrToType(LLType::Int8Ty); LLValue* lval = new llvm::AllocaInst(DtoType(type), "tmpdelegate", p->topallocapoint());