[Issue 7682] New: shared array type and "cast() is not an lvalue" error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 11 04:31:34 PDT 2012


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

           Summary: shared array type and "cast() is not an lvalue" error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-03-11 04:31:40 PDT ---
Comment out of line A will suppress the error in line B.
----
template ConstOf(T)
{
    alias const(T) ConstOf;
}
void main()
{
    shared(ConstOf!(int[])) x;  // line A

    struct S3 { int[10] a; }
    shared(S3) sh3;
    shared(int[]) sh3sub = sh3.a[];
    assert(pointsTo(sh3sub));   // line B
        // Error: cast(shared(const(int[])))sh3sub is not an lvalue
}
bool pointsTo(S)(ref const S source) @trusted pure nothrow
{
    return true;
}

-- 
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