mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
Fix bug #307 by doing what DMD does: add the arrayop to
sc->module->importedFrom instead of sc->module. That way array ops in template instantiations will be semantic3'ed.
This commit is contained in:
@@ -281,10 +281,10 @@ Expression *BinExp::arrayOp(Scope *sc)
|
||||
// special attention for array ops
|
||||
fd->isArrayOp = true;
|
||||
|
||||
sc->module->members->push(fd);
|
||||
sc->module->importedFrom->members->push(fd);
|
||||
|
||||
sc = sc->push();
|
||||
sc->parent = sc->module;
|
||||
sc->parent = sc->module->importedFrom;
|
||||
sc->stc = 0;
|
||||
sc->linkage = LINKd;
|
||||
fd->semantic(sc);
|
||||
|
||||
@@ -1369,13 +1369,13 @@ bool mustDefineSymbol(Dsymbol* s)
|
||||
{
|
||||
if (FuncDeclaration* fd = s->isFuncDeclaration())
|
||||
{
|
||||
if (fd->isArrayOp)
|
||||
return true;
|
||||
|
||||
// we can't (and probably shouldn't?) define functions
|
||||
// that weren't semantic3'ed
|
||||
if (fd->semanticRun < 4)
|
||||
return false;
|
||||
|
||||
if (fd->isArrayOp)
|
||||
return true;
|
||||
}
|
||||
|
||||
TemplateInstance* tinst = DtoIsTemplateInstance(s);
|
||||
|
||||
Reference in New Issue
Block a user