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

Add notes regarding using inline delegates with Scheduler.AddOnce #6023

Merged
merged 1 commit into from Oct 10, 2023

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Oct 10, 2023

No description provided.

Comment on lines +432 to +433
// Note that while this works here (even with a capture), there's no guarantee that will always be the
// case. As such it's always best to use a local function or private method.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm... surprised that this works...

In this case the compiler has somehow decided that it can correctly reduce the inline delegate to a method group:

1696945472

For comparison, an actual method group:

1696945522

Wizardry I tell ya...

@bdach bdach merged commit ba72c19 into ppy:master Oct 10, 2023
17 of 21 checks passed
@peppy peppy deleted the inline-delegate-add-once branch November 11, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants