www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 933] New: Literal tuple parameters fails to compile when inout is mentioned

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: korslund 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.


-- 
Feb 06 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=933






Added to DStress as
http://dstress.kuehne.cn/run/t/tuple_20_A.d
http://dstress.kuehne.cn/run/t/tuple_20_B.d


-- 
Apr 05 2007