Skip to content

Field keyword becomes an IInvalidOperation in OperationWalker #79201

@jtschuster

Description

@jtschuster

Version Used: 5.0.0-1.25321.102

Steps to Reproduce:

  1. Create a file with the field keyword in a property.
  2. Create a compilation with CSharpVersion.Preview with an analyzer that includes an OperationWalker.
  3. Break on OperationWalker.VisitInvalid(), there is an InvalidOperation corresponding to the syntax field.

See the FieldKeyword test in the ILLink.RoslynAnalyzer.Tests project in dotnet/runtime#117072.

Expected Behavior: I would expect the syntax field in a property to be an IFieldReferenceOperation.

Actual Behavior: It is an IInvalidOperation.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions