January 02, 2014 [Issue 11860] New: with(expr) statement doesn't allow static methods on expr to be called with UFCS | ||||
---|---|---|---|---|
| ||||
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 --- Comment #0 from Dylan Knutson <tcdknutson@gmail.com> 2014-01-02 15:16:45 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: ------- |
Copyright © 1999-2021 by the D Language Foundation