D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6859 - Segfault when abstract method uses with contract.
Summary: Segfault when abstract method uses with contract.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, wrong-code
Depends on:
Blocks:
 
Reported: 2011-10-27 09:32 UTC by Koichi
Modified: 2011-11-08 00:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Koichi 2011-10-27 09:32:59 UTC
This code doesn't work!

--------------------
import std.stdio;
 
void main(string[] args)
{
        auto t = new Child;
        t.fuga();
        writeln("done.");
}
 
class Parent
{
public:
        bool isHage() const @property;
 
public:
        abstract void fuga()
        out
        {
                assert(isHage);
        }
        body { }
}
 
class Child : Parent
{
        override bool isHage() const @property
        {
                return true;
        }
        override void fuga()
        {
                //nop
        }
}
--------------------