Bug 7272 – `out` section makes return type `const` in `return` statement
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2012-01-11T10:01:00Z
Last change time
2012-01-12T20:29:56Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2012-01-11T10:01:55Z
---
int* f()
out { } // no errors with `out` section
body {
immutable(int)* ptr;
return ptr;
}
---
If `immutable(int)*` is changed to `immutable(void)*` we have the following error:
`Error: cannot implicitly convert expression (ptr) of type immutable(void)* to const(int*)` illustrating the issue. Note, that `typeof(f())` and `typeof(return)` are `int*`.
Maybe concerned with Issue 1313
Comment #1 by k.hara.pg — 2012-01-12T20:29:56Z
I've posted a patch to fix 1313, and confirmed that this is a dup of it.
*** This issue has been marked as a duplicate of issue 1313 ***