[Issue 11860] New: with(expr) statement doesn't allow static methods on expr to be called with UFCS
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 2 15:16:50 PST 2014
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 at puremagic.com
ReportedBy: tcdknutson at gmail.com
--- Comment #0 from Dylan Knutson <tcdknutson at 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: -------
More information about the Digitalmars-d-bugs
mailing list