www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5810] New: BigInt++ 'no effect' problem

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5810

           Summary: BigInt++ 'no effect' problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



import std.bigint;
struct Foo {
    BigInt x;
    void bar() { x++; }
}
void main() {}


DMD 2.052 shows:

test.d(4): Error: var has no effect in expression (__tmp19)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5810


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |clugdbug yahoo.com.au
            Summary|BigInt++ 'no effect'        |Struct postincrement
                   |problem                     |generates 'no effect' error
                   |                            |if used on struct member



It's nothing to do with BigInt. Here's a reduced test case:

struct Bug5810 {
    void opUnary(string op)()    { }
}

struct Foo {
    Bug5810 x;
    void bar() { x++; }
}

test2.d(13): Error: var has no effect in expression (__pitmp4)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 06 2011