[Issue 6549] Implement contracts without implementation.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 28 03:46:43 PST 2012


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


Shahid <govellius at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |govellius at gmail.com


--- Comment #1 from Shahid <govellius at gmail.com> 2012-01-28 03:46:36 PST ---
I would like a clarification about abstract class/methods with contracts.
Should the bottom two examples be valid D code?

----
// Works ( and documented TDPL/website )
interface I {
        int func( int x )
        in { assert(x == 0); }
}
class C : I {
        int func( int x ) { return x; }
}

// Does not work ( undocumented )
abstract class A
{
        int func( int x )
        in { assert(x == 0); }
}
// ditto
class A2 {
        abstract int func( int x )
        in { assert(x == 0); }
}

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