[Issue 20428] New: Precondition bug for in/out
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 4 09:15:51 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20428
Issue ID: 20428
Summary: Precondition bug for in/out
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: cr at tagion.org
Created attachment 1770
--> https://issues.dlang.org/attachment.cgi?id=1770&action=edit
This file contains test example and a log file
Hej Alle.
This the pre-condtion bug has been around for a while now, and it is stated
that it should be fixed.
But it doesn't seem to be.
I have test that this bug is in alle version dmd/ldc2/gdc.
I my view the pre- and post-conditions stated in an interface or and abstract
member function should also be apply to the class which implements this
function or overide the this member function
Ex.
interface I {
int func(int x)
in {
assert(x < 10);
}
}
class C : I {
int func(int x) {
return x*x;
}
}
So I would expect the C.func function to fail if I call it with value 11, but
it does not.
In the attachment you can find a log-file and the and test example.
The logfile also include information about the OS and the compiler versions use
to test this bug.
Keep up the good work!
--
More information about the Digitalmars-d-bugs
mailing list