Hey,
Following Nullable update, I'm not clear about the following declaration inside ReflectionTypeLoadException:
public Type[]? Types { get; }
The documentation clearly states:
An array of type Type containing the classes that were defined in the module and loaded. This array can contain some null values.
As such, writing such a code:
catch (ReflectionTypeLoadException e)
{
return e.Types?.Where(t => t != null).Select(t => t.GetTypeInfo()) ?? Array.Empty<TypeInfo>();
}
Provides a warning on the where, as t is not marked as nullable.
Shouldn't the declaration be:
public Type?[]? Types { get; }
This seems to match the code:
https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Reflection/ReflectionTypeLoadException.cs#L41
However, the constructor syntax doesn't seem to match.
@mimisasouvanh @joelmartinez can you file a bug to investigate this?
@mairaw @yfital @joelmartinez Internal bug logged.