Skip to content

Support top level statements in event hookup#58475

Merged
davidwengier merged 2 commits intodotnet:mainfrom
davidwengier:EventHookupInTopLevelCode
Dec 24, 2021
Merged

Support top level statements in event hookup#58475
davidwengier merged 2 commits intodotnet:mainfrom
davidwengier:EventHookupInTopLevelCode

Conversation

@davidwengier
Copy link
Copy Markdown
Member

Fixes #58474

@davidwengier davidwengier requested a review from a team as a code owner December 23, 2021 22:04
@ghost ghost added the Area-IDE label Dec 23, 2021
@davidwengier davidwengier enabled auto-merge (squash) December 23, 2021 22:38
@davidwengier davidwengier merged commit 678b269 into dotnet:main Dec 24, 2021
@ghost ghost added this to the Next milestone Dec 24, 2021
@davidwengier davidwengier deleted the EventHookupInTopLevelCode branch December 24, 2021 02:17
SemanticDocument semanticDocument,
string eventHandlerMethodName,
AssignmentExpressionSyntax eventHookupExpression,
MethodKind methodKind,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@davidwengier While this change makes sense, I wonder how things were working in #50726 without this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hmm.. good question. Perhaps a change in the code generation bits since then?

Apologies for not noticing the existing issue/pr

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps a change in the code generation bits since then?

I took a quick look from sourceroslyn.io and can't really find how this can affect anything. Going to open a quick draft to see what exactly fails as I'm curious.

Apologies for not noticing the existing issue/pr

No problem!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wouldn't be surprised if it's unnecessary, but I definitely saw a failure at one point where the access modifier was added to the local function, which obviously was wrong. I can't remember exactly what the rest of the code looked like at that point though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

event handlers are not generated in top level programs.

4 participants