Skip to content

Commit

Permalink
Data.Common add DynamicallyAccessMembers attribs (#75980)
Browse files Browse the repository at this point in the history
The existing APICompat tooling doesn't indicate a compatibility error when comparing the contract assembly against the implementation assembly and the `[return: ...]` attributes aren't in sync. The new tooling that is being bootstrapped in dotnet/runtime via #73263 does flag them.

In this case a few type members were missing the `DynamicallyAccessedMembers` return attribute in the contract.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
  • Loading branch information
github-actions[bot] and ViktorHofer authored Sep 23, 2022
1 parent a5e1fd5 commit 264b675
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ public override void Close() { }
public override decimal GetDecimal(int ordinal) { throw null; }
public override double GetDouble(int ordinal) { throw null; }
public override System.Collections.IEnumerator GetEnumerator() { throw null; }
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Type GetFieldType(int ordinal) { throw null; }
public override float GetFloat(int ordinal) { throw null; }
public override System.Guid GetGuid(int ordinal) { throw null; }
Expand All @@ -945,6 +946,7 @@ public override void Close() { }
public override long GetInt64(int ordinal) { throw null; }
public override string GetName(int ordinal) { throw null; }
public override int GetOrdinal(string name) { throw null; }
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Type GetProviderSpecificFieldType(int ordinal) { throw null; }
public override object GetProviderSpecificValue(int ordinal) { throw null; }
public override int GetProviderSpecificValues(object[] values) { throw null; }
Expand Down Expand Up @@ -2315,6 +2317,7 @@ protected virtual void Dispose(bool disposing) { }
public abstract double GetDouble(int ordinal);
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public abstract System.Collections.IEnumerator GetEnumerator();
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Type GetFieldType(int ordinal);
public System.Threading.Tasks.Task<T> GetFieldValueAsync<T>(int ordinal) { throw null; }
public virtual System.Threading.Tasks.Task<T> GetFieldValueAsync<T>(int ordinal, System.Threading.CancellationToken cancellationToken) { throw null; }
Expand All @@ -2327,6 +2330,7 @@ protected virtual void Dispose(bool disposing) { }
public abstract string GetName(int ordinal);
public abstract int GetOrdinal(string name);
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public virtual System.Type GetProviderSpecificFieldType(int ordinal) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual object GetProviderSpecificValue(int ordinal) { throw null; }
Expand Down Expand Up @@ -2373,6 +2377,7 @@ protected DbDataRecord() { }
protected virtual System.Data.Common.DbDataReader GetDbDataReader(int i) { throw null; }
public abstract decimal GetDecimal(int i);
public abstract double GetDouble(int i);
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Type GetFieldType(int i);
public abstract float GetFloat(int i);
public abstract System.Guid GetGuid(int i);
Expand Down

0 comments on commit 264b675

Please sign in to comment.