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

Add support for delegate parameters #70

Open
maca88 opened this issue Nov 7, 2017 · 4 comments
Open

Add support for delegate parameters #70

maca88 opened this issue Nov 7, 2017 · 4 comments

Comments

@maca88
Copy link
Owner

maca88 commented Nov 7, 2017

Example:

public class MethodWithDelegate
{
    public void Test()
    {
        Read(() => SimpleFile.Read());
    }

    public void Read(Action action)
    {
        action();
        SimpleFile.Read();
    }
}

Desired result

public partial class MethodWithDelegate
{
    public Task TestAsync()
    {
        return ReadAsync(() => SimpleFile.ReadAsync());
    }

    public async Task ReadAsync(Func<Task> action)
    {
        await action();
        await SimpleFile.ReadAsync();
    }
}
@hazzik
Copy link
Contributor

hazzik commented Nov 7, 2017

I think the title needs to be refined:)

@maca88
Copy link
Owner Author

maca88 commented Nov 7, 2017

Hmm what do you suggest? :)
The idea of this issue is about parameter transformation e.g. from Action to Func<Task>, once the parameter would be marked to be asyncable then the argument would be also converted. The logic for converting the argument is already implemented.

@hazzik
Copy link
Contributor

hazzik commented Nov 7, 2017

I don't know. It's just you've had "Add better support for delegate arguments" now "Add support for delegate parameters". Or is it in the difference between "arguments" and "parameters"?

@maca88
Copy link
Owner Author

maca88 commented Nov 7, 2017

Or is it difference between "arguments" and "parameters"?

Yes. I know that the titles are almost the same but main difference is argument vs parameter. Transforming an argument is different from transforming a parameter. I'm open to suggestions for a better title name :)

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

2 participants