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

Handle static methods marked as commands. #35

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

mayuki
Copy link
Owner

@mayuki mayuki commented Aug 24, 2021

This PR enables Cocona to handle static methods that are marked as commands.

class Program
{
    [Command]
    public static void Foo()
        => Console.WriteLine("Foo");
}

Limitation

  • The method needs to be explicitly marked as a command. ([Command])
  • The type containing the method must be not static class. (static class is compiled as abstract class).

@mayuki mayuki merged commit 42dc381 into master Aug 24, 2021
@mayuki mayuki deleted the feature/StaticMethod branch August 24, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant