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: nob...@puremagic.com
        ReportedBy: s...@iname.com


--- Comment #0 from Stewart Gordon <s...@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: -------

Reply via email to