Skip to content

NativeAot doesn't warn for base/override annotation mismatch on generic virtual methods #77744

@sbomer

Description

@sbomer

Description

NativeAot is missing warnings for virtual base/override validation when the virtual method is generic.

Reproduction Steps

class G
{
    public virtual void M<[DAM(DAMT.All)]T>([DAM(DAMT.All)] Type t) {}

    public virtual void M([DAM(DAMT.All)] Type t) {}
}

class D : G
{
    public override void M<T>(Type t) {} // no warning (for T or t)

    public override void M(Type t) {} // warning
}

Expected behavior

The generic parameter and the Type parameter of the derived method should warn about mismatching annotations.

Actual behavior

No warning

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

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