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

Improve handling ability for result type. #4

Open
kekyo opened this issue Mar 10, 2022 · 0 comments
Open

Improve handling ability for result type. #4

kekyo opened this issue Mar 10, 2022 · 0 comments

Comments

@kekyo
Copy link
Owner

kekyo commented Mar 10, 2022

Will validate return type both Task and ValueTask.

public Task<int> Sum(int a, int b) => Task.FromResult(a + b);
public ValueTask<int> Sum(int a, int b) => new ValueTask<int>(a + b);

Will validate any constant return type with synchronized method/function.

.NET:

public int Sum(int a, int b) => a + b;

// Requires dirty naming (ex: namespace).
using DupeNukem.Synchronized;
messenger.RegisterFunc<int, int, int>(this.Sum);

JavaScript:

/* async */ function add(a, b) {
  return a + b;
}
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

No branches or pull requests

1 participant