Merge 2.058beta

This commit is contained in:
Alexey Prokhin
2012-02-12 14:42:37 +04:00
parent f2ed2e96b0
commit e74e55df89
64 changed files with 5261 additions and 2974 deletions

View File

@@ -851,6 +851,12 @@ void Module::importAll(Scope *prevsc)
if (scope)
return; // already done
if (isDocFile)
{
error("is a Ddoc file, cannot import it");
return;
}
/* Note that modules get their own scope, from scratch.
* This is so regardless of where in the syntax a module
* gets imported, it is unaffected by context.
@@ -858,14 +864,14 @@ void Module::importAll(Scope *prevsc)
*/
Scope *sc = Scope::createGlobal(this); // create root scope
// Add import of "object" if this module isn't "object"
if (ident != Id::object)
// Add import of "object", even for the "object" module.
// If it isn't there, some compiler rewrites, like
// classinst == classinst -> .object.opEquals(classinst, classinst)
// would fail inside object.d.
if (members->dim == 0 || ((*members)[0])->ident != Id::object)
{
if (members->dim == 0 || ((*members)[0])->ident != Id::object)
{
Import *im = new Import(0, NULL, Id::object, NULL, 0);
members->shift(im);
}
Import *im = new Import(0, NULL, Id::object, NULL, 0);
members->shift(im);
}
if (!symtab)