Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with(expr) statement doesn't allow static methods on expr to be called with UFCS #18747

Open
dlangBugzillaToGithub opened this issue Jan 2, 2014 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

Dylan Knutson (@dymk) reported this on 2014-01-02T15:16:45Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=11860

Description

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.
@dlangBugzillaToGithub
Copy link
Author

b2.temp commented on 2020-07-04T17:32:39Z

UFCS on member funcs is not supported, this is not specific to with().
THie issue is rather an ER.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant