Beta D 2.068.1-b2

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Aug 31 00:08:47 PDT 2015


On 2015-08-31 08:01, Martin Nowak wrote:
> First beta for the 2.068.1 point release (we skipped -b1 due to a bug).

I started compile my projects with DMD 2.068.0 (yes, I know I'm a bit 
late). I noted that this piece of code that compiles in 2.067.0 doesn't 
compile in 2.068.0 (or 2.068.1-b2) :

class Foo
{
     override string toString()
     in { }
     body
     {
         return "foo";
     }
}

The error message I get is:

main.d(3): Error: function main.Foo.toString cannot have an in contract 
when overriden function object.Object.toString does not have an in contract

The above code is a minimal testcase extracted from Tango.

The question is, is this a regression or expected? I suspect it's 
expected. The check was added four years ago, although I don't 
understand why it hasn't been hit before.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list