digitalmars.D.bugs - [Issue 11860] New: with(expr) statement doesn't allow static methods on expr to be called with UFCS
- d-bugmail puremagic.com (38/38) Jan 02 2014 https://d.puremagic.com/issues/show_bug.cgi?id=11860
https://d.puremagic.com/issues/show_bug.cgi?id=11860 Summary: with(expr) statement doesn't allow static methods on expr to be called with UFCS Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: tcdknutson gmail.com PST --- This isn't supported: ``` import std.stdio; void main() { struct MyStruct { static void doIt(string thing) { writeln(thing); } } with(MyStruct) { "print me".doIt(); } } ``` Does it make sense for it to be supported? I've got a use case for it that deals with letting the user supply their own struct with custom static methods on it, with the struct acting as a "wrapper" for loose functions. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 02 2014