# HG changeset patch # User Christian Kamm # Date 1242980267 -7200 # Node ID afecdb8ee962d1c61c612e75d05843c5bef4d14c # Parent eb7cb41ee585431722295bcf916cb50230d02c35 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. diff -r eb7cb41ee585 -r afecdb8ee962 dmd/arrayop.c --- a/dmd/arrayop.c Thu May 21 18:08:31 2009 +0200 +++ b/dmd/arrayop.c Fri May 22 10:17:47 2009 +0200 @@ -281,10 +281,10 @@ // 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); diff -r eb7cb41ee585 -r afecdb8ee962 gen/llvmhelpers.cpp --- a/gen/llvmhelpers.cpp Thu May 21 18:08:31 2009 +0200 +++ b/gen/llvmhelpers.cpp Fri May 22 10:17:47 2009 +0200 @@ -1369,13 +1369,13 @@ { 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);