Skip to content

Use ContainingType instead of ContainingSymbol in GetReferenceKind#3107

Merged
jtschuster merged 2 commits intodotnet:mainfrom
jtschuster:containingType
Nov 10, 2022
Merged

Use ContainingType instead of ContainingSymbol in GetReferenceKind#3107
jtschuster merged 2 commits intodotnet:mainfrom
jtschuster:containingType

Conversation

@jtschuster
Copy link
Copy Markdown
Member

Expecting IMethodSymbol.ContainingSymbol to be an ITypeSymbol is causing a type cast exception for local methods that require dataflow analysis (#3106), and it makes more sense to use ContainingType. I haven't been able to repro the issue (I've had problems building asp.net), but it seems pretty clear this is the fix.

@jtschuster jtschuster requested a review from sbomer as a code owner November 10, 2022 00:57
Copy link
Copy Markdown
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

Thanks! The fix looks ok to me but we should at least have a testcase.

Just to make sure you saw it, the original issue mentioned it was caused by this line: https://github.com/dotnet/aspnetcore/blob/45a75ad446294116024e640bb7efabfcfe2ac210/src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs#L132 - in case that helps trying to get a repro/testcase.

@jtschuster jtschuster merged commit 9c993bf into dotnet:main Nov 10, 2022
tlakollo pushed a commit to tlakollo/linker that referenced this pull request Dec 20, 2022
tlakollo pushed a commit to tlakollo/runtime that referenced this pull request Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants