You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Annotating a parameter on a local function with [DynamicallyAccessedMembers] causes ILLink.RoslynAnalyzer.DynamicallyAccessedMembersAnalyzer to throw the following exception:
CSC : error AD0001: Analyzer 'ILLink.RoslynAnalyzer.DynamicallyAccessedMembersAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.MethodSymbol' to type 'Microsoft.CodeAnalysis.ITypeSymbol'.'.
I think this cast is the issue - when the method is a local function, its containing symbol might be a method. @jtschuster would you mind taking a look?
FYI this issue impacts the dotnet/aspnetcore repository and blocks us from updating the SDK. It's not urgent to update the SDK, but prompt progress would be appreciated.
Describe the bug
Annotating a parameter on a local function with
[DynamicallyAccessedMembers]
causesILLink.RoslynAnalyzer.DynamicallyAccessedMembersAnalyzer
to throw the following exception:This was observed in dotnet/aspnetcore#44925. The culprit was this line.
SDK version with the bug:
8.0.100-alpha.1.22556.1
Last known SDK version without the bug:
8.0.100-alpha.1.22531.1
Steps to reproduce
Expected behavior
The build completes successfully.
Actual behavior
The build fails with the aforementioned error.
The text was updated successfully, but these errors were encountered: