Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch

--- Comment #2 from Don <>  2009-06-03 16:07:40 PDT ---
Root cause: semantic3 never gets run on the function which 
is created, if it's compiled in a module which doesn't instantiate the
template it's in. To fix this, we can run its semantic3 immediately, since
we're already in semantic3 for this module.
BTW: It also seems to me that the back-end should have
assert(FuncDeclaration->semanticRun==4) before running toObj(), to ensure
semantic3 has been run (it would be a better place to ICE).
BTW: FuncDeclaration::toObj() is declared but never defined or used.

PATCH: Add this code to arrayop.c, BinExp::arrayOp, line 393.

        sc->linkage = LINKc;
+          fd->semantic2(sc);
+          fd->semantic3(sc);

// TEST CASE 1. Compilation order is important.
dmd bugx.d bug.d
import bugx;
void main(){
void foo(T)() {
   long[] a;
   a[] = -a[];
// TEST CASE 2: replace bugx with:
void foo(T)() {
   T[] a;
   a[] = -a[];

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to