Summary: No implicit conversion with "alias property this"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Shin Fujishiro <> 2010-10-21 10:05:37 PDT 
Implicit conversion with help of alias this doesn't work if the aliased symbol
is a property (or just nullary) function.  The following code doesn't compile:
void main()
    S s;
    int[] conv = s; // (4)
struct S
    @property int[] get() { return [1,2,3]; }
    alias get this;
% dmd -o- -c test.d
test.d(4): Error: cannot implicitly convert expression (s) of type S to int[]
The repro code compiles fine if 'get' is a variable.

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

Reply via email to