Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

[DAM analyzer] Don't produce dataflow warnings for annotations on invalid types #2598

Closed

Description

@sbomer

When typeof(T).TypeHandle flows into an unannotated location, the linker and analyzer are both producing warnings about an unknown value failing to meet the DAM requirements. There are two problems here:

  • We shouldn't be producing warnings for unknown values when there are no requirements.
  • We aren't flowing annotations on T through get_TypeHandle. I think it would make sense to do this.

I think we should fix it by propagating the annotations from the generic parameter through get_TypeHandle.

Activity

  1. self-assigned this
    on Feb 11, 2022
  2. sbomer commented on Feb 11, 2022

    @sbomer
    MemberAuthor

    I realized it doesn't make sense to propagate through get_TypeHandle because we don't support annotations on RuntimeTypeHandle. The current logic is ok because it will propagate the annotation if you do Type.GetTypeFromHandle(typeof(T).TypeHandle).

    The issue we saw in runtime was just that we're producing a warning even though the target is an unsupported type for the annotations - which @tlakollo is working on as part of #2409. I'll leave this issue to track not producing dataflow warnings for unsupportred annotated locations (while the other issue tracks adding warnings for the invalid annotations).

  3. changed the title [-][DAM analyzer] Analyzer and linker produce warning for generic parameter TypeHandle[/-] [+][DAM analyzer] Don't produce dataflow warnings for annotations on invalid types[/+] on Feb 11, 2022
  4. assigned and unassigned on Feb 11, 2022
  5. tlakollo commented on Feb 15, 2022

    @tlakollo
    Contributor

    Closed via #2599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions