Skip to content

InvalidCastException in ValueTracking #57100

@yyjdelete

Description

@yyjdelete

Version Used:
VS2022 Version 17.0.0 Preview 4.1

Steps to Reproduce:

        public int this[string key] => 0;
  1. Right click, and click Track Value Source with key

Expected Behavior:

Actual Behavior:

System.InvalidCastException: Cannot cast an object of type "Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.PropertySymbol" to type "Microsoft.CodeAnalysis.IMethodSymbol".
      at Microsoft.CodeAnalysis.ValueTracking.ValueTracker.<TrackParameterSymbolAsync>d__4.MoveNext()
      at Microsoft.CodeAnalysis.ValueTracking.ValueTracker.<TrackValueSourceAsync>d__1.MoveNext()
      at Microsoft.CodeAnalysis.Remote.RemoteValueTrackingService.<>c__DisplayClass3_0.<<TrackValueSourceAsync>b__0>d.MoveNext()
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.<RunServiceImplAsync>d__12`1.MoveNext()

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions