Skip to content

Analyzer doesn't visit Instance of all member references #2832

@sbomer

Description

@sbomer

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:

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
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions