dotnet / linker

388 stars 126 forks source link

Use ContainingType instead of ContainingSymbol in GetReferenceKind #3107

Closed jtschuster closed 1 year ago

jtschuster commented 1 year ago

Expecting IMethodSymbol.ContainingSymbol to be an ITypeSymbol is causing a type cast exception for local methods that require dataflow analysis (https://github.com/dotnet/linker/issues/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.