[Issue 933] New: Literal tuple parameters fails to compile when inout is mentioned
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 6 04:47:26 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=933
Summary: Literal tuple parameters fails to compile when inout is
mentioned
Product: D
Version: 1.004
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: korslund at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list