[Issue 5145] Regression(2.050, 1.065) override error with forward ref of superclass

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 1 01:02:45 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5145


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid
                 CC|                            |clugdbug at yahoo.com.au
            Version|D1                          |D1 & D2
            Summary|override error with forward |Regression(2.050, 1.065)
                   |ref of superclass           |override error with forward
                   |                            |ref of superclass
         OS/Version|Mac OS X                    |All


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-11-01 01:01:43 PDT ---
Applies to both D1 and D2.

This was caused by svn683, which fixed bug 3602 "ICE(tocsym.c) compiling a
class, if its super class has preconditions"

And the problem is that it's using the scope from the parent function, which
isn't quite right: some of the attributes should be dropped. I don't know if
anything other than STCoverride can cause problems.


func.c, FuncDeclaration::mergeFrequire, line 1688.

        FuncDeclaration *fdv = (FuncDeclaration *)foverrides.data[i];

        /* The semantic pass on the contracts of the overridden functions must
         * be completed before code generation occurs (bug 3602).
         */
        if (fdv->fdrequire && fdv->fdrequire->semanticRun != PASSsemantic3done)
        {
            assert(fdv->scope);
+            StorageClass oldstc = fdv->scope->stc;
+            fdv->scope->stc &= ~ STCoverride;
            fdv->semantic3(fdv->scope);
+            fdv->scope->stc = fdv->scope->stc;
        }

        sf = fdv->mergeFrequire(sf);
        if (fdv->fdrequire)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list