[Issue 23678] New: Contracts are compiled with release switch?
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 7 19:55:44 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23678
Issue ID: 23678
Summary: Contracts are compiled with release switch?
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: chalucha at gmail.com
Test case:
```D
version (assert) int foo;
void test()
in (!foo)
{}
void main() {
test();
}
```
When built with `-release`, `foo` is not compiled in and compilation fails
with:
```
Error: undefined identifier `foo`
```
Should't the contract be dropped too in release builds?
--
More information about the Digitalmars-d-bugs
mailing list