Skip to content

Commit

Permalink
Suppress trimmer warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-karas committed Aug 13, 2021
1 parent 5467077 commit 9096bff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libraries/System.Data.OleDb/src/OleDbDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Data.Common;
using System.Data.ProviderBase;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -329,7 +330,14 @@ private DataTable BuildSchemaTable(MetaData[] metadata)
DataColumn precision = new DataColumn("NumericPrecision", typeof(short));
DataColumn scale = new DataColumn("NumericScale", typeof(short));

DataColumn dataType = new DataColumn("DataType", typeof(System.Type));
DataColumn dataType = GetSystemTypeDataColumn();

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2110",
Justification = "The problem is Type.TypeInitializer which requires static .ctor on the type" +
"which in this case is System.Type itself. System.Type.cctor will always be preserved anyway.")]
static DataColumn GetSystemTypeDataColumn() =>
new DataColumn(SchemaTableColumn.DataType, typeof(Type));

DataColumn providerType = new DataColumn("ProviderType", typeof(int));

DataColumn isLong = new DataColumn("IsLong", typeof(bool));
Expand Down

0 comments on commit 9096bff

Please sign in to comment.