Summary: Broken semantic of StructInitializer with const
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Kenji Hara <> 2012-04-16 18:01:45 PDT ---
>From d.learn newsgroup:$ra2$

struct S
    int [] numbers;

void main()
    const int [] numbers = new int[2];
    const S si = {numbers};
    // Error: cannot implicitly convert expression (numbers) of type
    // const(int[]) to int[]

    const S se = const(S)(numbers);
    // OK

This is a bug in processing StructInitializer semantic.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to