Skip to content

Commit bdd5bfe

Browse files
committed
CR feedback
1 parent b96ce9c commit bdd5bfe

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The .NET Foundation licenses this file to you under the MIT license.
109109
</ItemGroup>
110110

111111
<ItemGroup>
112-
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll" Exclude="@(_ExcludedPrivateSdkAssemblies)"/>
112+
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll" />
113113

114114
<!-- Exclude unmanaged dlls -->
115115
<FrameworkAssemblies Include="$(IlcFrameworkPath)*.dll" Exclude="$(IlcFrameworkPath)*.Native.dll;$(IlcFrameworkPath)msquic.dll" />
@@ -149,7 +149,7 @@ The .NET Foundation licenses this file to you under the MIT license.
149149

150150
<!-- If running from a package these values need to be set again with the resolved IlcXYZPath -->
151151
<ItemGroup>
152-
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll" Exclude="@(_ExcludedPrivateSdkAssemblies)"/>
152+
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll" />
153153

154154
<!-- Exclude unmanaged dlls -->
155155
<FrameworkAssemblies Include="$(IlcFrameworkPath)*.dll" Exclude="$(IlcFrameworkPath)*.Native.dll;$(IlcFrameworkPath)msquic.dll" />

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/MethodInfos/CustomMethodMapper.Nullable.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ public static Dictionary<MethodBase, CustomMethodInvokerAction> Map
7777

7878
map.AddMethod(type, nameof(Nullable<int>.GetValueOrDefault), Array.Empty<Type>(), NullableGetValueOrDefault);
7979

80+
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:ParameterDoesntMeetParameterRequirements",
81+
Justification = "Constructed MethodTable of a Nullable forces a constructed MethodTable of the element type")]
8082
static object NullableGetValueOrDefault(object thisObject, object[] args,
81-
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)]
8283
Type thisType)
8384
{
8485
if (thisObject == null)

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/MethodInfos/RuntimeNamedMethodInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public sealed override MethodInfo MakeGenericMethod(params Type[] typeArguments)
135135
throw new ArgumentNullException();
136136

137137
if (typeArgument is not RuntimeType)
138-
throw new ArgumentException(SR.Format(SR.Reflection_CustomReflectionObjectsNotSupported, typeArguments[i]), "typeArguments[" + i + "]"); // Not a runtime type.
138+
throw new PlatformNotSupportedException(SR.Format(SR.Reflection_CustomReflectionObjectsNotSupported, typeArguments[i]));
139139

140140
if (typeArgument.IsByRefLike)
141141
throw new BadImageFormatException(SR.CannotUseByRefLikeTypeInInstantiation);

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/TypeInfos/RuntimeTypeInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public sealed override Type MakeGenericType(params Type[] typeArguments)
465465
}
466466
else
467467
{
468-
throw new PlatformNotSupportedException(SR.PlatformNotSupported_MakeGenericType); // "PlatformNotSupported" because on desktop, passing in a foreign type is allowed and creates a RefEmit.TypeBuilder
468+
throw new PlatformNotSupportedException(SR.Format(SR.Reflection_CustomReflectionObjectsNotSupported, typeArguments[i]));
469469
}
470470
}
471471
}

src/libraries/System.Private.CoreLib/src/Resources/Strings.resx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3949,9 +3949,6 @@
39493949
<data name="NoMetadataTokenAvailable" xml:space="preserve">
39503950
<value>There is no metadata token available for the given member.</value>
39513951
</data>
3952-
<data name="PlatformNotSupported_MakeGenericType" xml:space="preserve">
3953-
<value>PlatformNotSupported_MakeGenericType", @"MakeGenericType can only accept Type objects created by the runtime.</value>
3954-
</data>
39553952
<data name="ArgumentException_InvalidTypeArgument" xml:space="preserve">
39563953
<value>The type '{0}' may not be used as a type argument.</value>
39573954
</data>
@@ -3962,7 +3959,7 @@
39623959
<value>TypeHandles are not supported for types that return true for ContainsGenericParameters.</value>
39633960
</data>
39643961
<data name="Reflection_CustomReflectionObjectsNotSupported" xml:space="preserve">
3965-
<value>The object '{0}' was created by a custom ReflectionContext and cannot be used here.</value>
3962+
<value>The type '{0}' was created by a custom ReflectionContext and cannot be used here.</value>
39663963
</data>
39673964
<data name="CannotCreateByRefOfByRef" xml:space="preserve">
39683965
<value>Cannot create a byref of a byref: {0}</value>

0 commit comments

Comments
 (0)