Bug 933 – (D1 only) Literal tuple parameters fails to compile when inout is mentioned

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2007-02-06T06:47:19Z
Last change time
2019-05-16T09:30:02Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Nicolay Korslund

Comments

Comment #0 by korslund — 2007-02-06T06:47:19Z
struct Foo(T...) { void set(T t) {} // Comment out this and it works fine void get(inout T t) {} } void main() { Foo!(int) foo; foo.set(5); } Compiling (with DMD 1.005 on linux) gives: Error: constant 5 is not an lvalue even though foo.set() does NOT have inout parameters. Removing the get() method solves the problem.
Comment #1 by thomas-dloop — 2007-04-05T11:38:30Z
Comment #2 by razvan.nitu1305 — 2019-05-16T09:30:02Z
The code compiles and runs fine in D2. Closing as FIXED, since D1 is no longer maintained.