-
unsafe
{
static void h() { }
delegate*<void> p = default;
p = &h; // this is ok
p = &(static () => { }); // this should be ok too
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To me, this looks like something that would make function pointers slightly easier to use, with a somewhat peculiar syntax (because of the required parentheses). But function pointers are an advanced feature, which means small improvements in their convenience are probably not worthwhile. |
Beta Was this translation helpful? Give feedback.
-
I think that would also tie the compiler to a specific implementation of how static lambdas are emitted. They currently are instance methods on a singleton instance, but that would be incompatible with the function pointer. |
Beta Was this translation helpful? Give feedback.
-
Duplicate of #3476. |
Beta Was this translation helpful? Give feedback.
Duplicate of #3476.