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;
}
Will validate return type both
TaskandValueTask.Will validate any constant return type with synchronized method/function.
.NET:
JavaScript: