Fixed lambda inference

This commit is contained in:
Alexey Prokhin
2012-02-13 03:21:29 +04:00
parent 925303e334
commit eba8aac824
3 changed files with 17 additions and 6 deletions

View File

@@ -5306,6 +5306,15 @@ void TypeFunction::toDecoBuffer(OutBuffer *buf, int flag, bool mangle)
buf->writeByte('M');
ad->type->toDecoBuffer(buf, 0, false);
}
if (FuncLiteralDeclaration *literal = funcdecl->isFuncLiteralDeclaration()) {
// Never merge types of function literals of different kind
if (literal->tok == TOKreserved)
buf->writeByte('L');
else if (literal->tok == TOKfunction)
buf->writeByte('F');
else if (literal->tok == TOKdelegate)
buf->writeByte('D');
}
/* BUG This causes problems with delegate types
On the other hand, the llvm type for nested functions *is* different
so not doing anything here may be lead to bugs!