[Issue 5230] New: ICE(tocsym.c) overriding a method that has an out contract

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 17 09:44:01 PST 2010


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

           Summary: ICE(tocsym.c) overriding a method that has an out
                    contract
           Product: D
           Version: D1 & D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: regression
          Priority: P1
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: smjg at iname.com


--- Comment #0 from Stewart Gordon <smjg at iname.com> 2010-11-17 09:42:46 PST ---
Clearly the implementation of out contract inheritance is broken.

----- override_out_a.d -----
import override_out_b;

class Derived : Base {
    override int method() { return 69; }
}
----- override_out_b.d -----
class Base {
    int method()
    out (r) {}
    body { return 42; }
}
----- DMD 1.065 -----
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd override_out_a.d
override_out_b.d(3): Error: function __ensure forward declaration
linkage = 0
Assertion failure: '0' on line 381 in file 'tocsym.c'

abnormal program termination
----- DMD 2.050 -----
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd override_out_a.d
override_out_b.d(3): Error: function __ensure forward declaration
linkage = 0
Assertion failure: '0' on line 407 in file 'tocsym.c'

abnormal program termination
----------

Compiles successfully if the out contract is removed, or Base and Derived are
defined in the same module.

Adding an out contract to Derived.method doesn't change things.

This has broken SDWF.

-- 
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