Skip to content

Wrong message about duplicate suppression attributes #2095

@vitek-karas

Description

@vitek-karas

If a type is marked as a whole (via MarkEntireType) and it's also marked the normal way (MarkType) its custom attributes will be processed twice which leads to registering the same suppression attributes twice. This generates an Info message like:

ILLink: Element <typename> has more than one unconditional suppression. Note that only the last one is used.

Why is this a problem:

  • Noise - the output is wrong and confusing. But it's only visible when --verbose is turned on, which is not the default.
  • Performance - there's no need to process the attributes twice.

There's a bigger underlying problem which we've ran into couple of times already:
MarkEntireType is not a superset of MarkType and so it doesn't mark the type as processed. Right now this seems to work almost always but mostly by accident because it's VERY likely that MarkEntireType will eventually call MarkType as a result of marking members on the type.

There might be cases where this is wrong (types without members for example might cause trouble in some specific cases).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions