Bug 2799 – "out" contractual clause fails to compile for const returns

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-04-04T11:59:00Z
Last change time
2015-06-09T05:15:17Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-04-04T11:59:15Z
S fun(S)(S a) out(result) { } body { return a; } void main(string[] args) { const char[] a = "a"; fun(a); } Compiled in debug mode: ./test.d(25): Error: variable test.fun!(const(char[])).fun.result cannot modify const ./test.d(35): Error: template instance test.fun!(const(char[])) error instantiating
Comment #1 by dfj1esp02 — 2009-06-10T02:35:19Z
More detailed description in bug 2933 *** This issue has been marked as a duplicate of issue 2933 ***