http://d.puremagic.com/issues/show_bug.cgi?id=5094
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 AssignedTo: nob...@puremagic.com ReportedBy: rsi...@gmail.com --- Comment #0 from Shin Fujishiro <rsi...@gmail.com> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------