mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 11:03:14 +01:00
Merge dmd-1.073.
This commit is contained in:
20
dmd/module.c
20
dmd/module.c
@@ -726,6 +726,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.
|
||||
@@ -733,14 +739,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)
|
||||
|
||||
Reference in New Issue
Block a user