You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiler reports an error for Foo1.foo, but not for Foo2.foo.
class Obj1
{
string foo() { return ""; }
}
class Obj2
{
string foo();
}
class Foo1 : Obj1
{
// Error: function test.Foo1.foo cannot have an in contract
// when overriden function test.Obj1.foo does not have an in contract
override string foo()
in { }
body
{
return "foo";
}
}
class Foo2 : Obj2
{
// no error
override string foo()
in { }
body
{
return "foo";
}
}
----
The original mention is here:
http://forum.dlang.org/post/ms0uh4$24i6$1@digitalmars.com
With 2.067.x, following code had worked without any errors, but with 2.068.1, it makes an error.
class Foo
{
override string toString()
in { }
body
{
return "foo";
}
}
That's introduced by the druntime change that to directly use object.d than object.di file.
The text was updated successfully, but these errors were encountered:
dlang-bugzilla (@CyberShadow) commented on 2015-09-01T12:15:38Z
(In reply to Kenji Hara from comment #0)
> Compiler reports an error for Foo1.foo, but not for Foo2.foo.
FWIW - before DMD commit 0ab7722db17351cc8db67f54f36cdb85387bd1d7, the code compiled successfully.
Kenji Hara (@9rnsr) reported this on 2015-08-31T15:10:19Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=14988
CC List
Description
Compiler reports an error for Foo1.foo, but not for Foo2.foo. class Obj1 { string foo() { return ""; } } class Obj2 { string foo(); } class Foo1 : Obj1 { // Error: function test.Foo1.foo cannot have an in contract // when overriden function test.Obj1.foo does not have an in contract override string foo() in { } body { return "foo"; } } class Foo2 : Obj2 { // no error override string foo() in { } body { return "foo"; } } ---- The original mention is here: http://forum.dlang.org/post/ms0uh4$24i6$1@digitalmars.com With 2.067.x, following code had worked without any errors, but with 2.068.1, it makes an error. class Foo { override string toString() in { } body { return "foo"; } } That's introduced by the druntime change that to directly use object.d than object.di file.The text was updated successfully, but these errors were encountered: