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.