dotnet / dotnet/linker

Analyzer doesn't visit Instance of all member references

Open
#2,832 0 comments 0 reactions 1 assignee Claimed by @sbomer View on GitHub
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

If the instance is an expression which produces dataflow warnings, this causes the analyzer to miss warnings. The same issue likely exists for all operations which reference an object instance - so references to fields/properties/events/methods. Example:

```csharp
class AccessReturnedInstanceField {
int field;

static AccessReturnedInstanceField GetInstance ([DAM (DAMT.All)] Type unused) => null;

static void TestWrite ()
{
GetInstance (GetUnknownType ()).field = 1; // Should warn for GetUnknownType passed to GetInstance
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.