[Issue 10926] New: Const problem with ternary operator append

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 30 04:51:37 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10926

           Summary: Const problem with ternary operator append
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-08-30 04:51:36 PDT ---
void main() {
    const(int)[] a, b;
    int[] c, d;
    (true ? a : b) ~= 10; // OK
    pragma(msg, typeof(true ? a : c)); // const(int)[]
    (true ? a : c) ~= 20; // line 6, Error: a is not an lvalue
    (true ? c : d) ~= 30; // OK
}


DMD 2.064alpha gives:

test.d(6): Error: a is not an lvalue

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


More information about the Digitalmars-d-bugs mailing list