Open sbomer opened 1 year ago
Similar for fields:
class G<[DAM(DAMT.PublicMethods)] T> {}
[RUC("")]
class CInst<T> {
public static G<T> field; // IL2091
public G<T> instField; // IL2091
}
[RequiresUnreferencedCode("")]
public static void Test() {
var f = new CInst<int>().instField;
var g = CInst<int>.field;
}
I think these cases should not warn.
RUC on type silences warnings for code in members of the type, including generics warnings for methods. But it doesn't silence warnings about generics on the type itself:
I believe RUC on type should silence this warning. I can't think of a way to do something unsafe with
typeof(C<>)
that wouldn't cause warnings elsewhere.