http://d.puremagic.com/issues/show_bug.cgi?id=6905
Summary: ref acts as auto ref when return type is missing Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-11-07 11:17:13 PST --- struct Foo { int x; ref noReturnType() { return x; } } void main() { auto foo = Foo(); foo.noReturnType = 5; assert(foo.x == 5); } Should this be allowed? It doesn't make much sense, especially when you can write code like this: struct Foo { ref noReturnType() { return 1; // does an rvalue return } } void main() { auto foo = Foo(); auto x = foo.noReturnType(); } This compiles and only confuses the reader. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------