We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code to reproduce:
static { static int Compare<T, AltT, CompareT>(T lhs, AltT rhs, CompareT comp) where CompareT : delegate int (T lhs, AltT rhs) { return comp(lhs, rhs); } static int CompareSpaceship<T, AltT>(T lhs, AltT rhs) where int : operator T <=> AltT { return lhs <=> rhs; } public static int CompareAlt<T>(T lhs) where int : operator T <=> T { //return Compare<T, T, ?>(lhs, lhs, scope (lhs, rhs) => { return lhs <=> rhs; }); // Works //return Compare<T, T, ?>(lhs, lhs, => CompareSpaceship<T, T>); // Works return Compare<T, T, ?>(lhs, lhs, (lhs, rhs) => { return rhs <=> rhs; }); // Doesn't } }
Expected behavior is that the lambda version would work the same as CompareSpaceship
CompareSpaceship
Tested with: (Nightly 04/28/2024) Build aa4f9f7
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code to reproduce:
Expected behavior is that the lambda version would work the same as
CompareSpaceship
Tested with: (Nightly 04/28/2024) Build aa4f9f7
The text was updated successfully, but these errors were encountered: