You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update indexer delegate docs and add index validation
Generalize XML docs to support multi-dimensional indexers.
Wrap indexer setter delegates with index length validation.
Fix PropertyData invoker generics to use non-nullable TTarget.
Copy file name to clipboardExpand all lines: src/BionicCode.Utilities.Reflection/DelegateProvider.cs
+13-9Lines changed: 13 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -837,7 +837,7 @@ public static PropertyGetter<TTarget, TValue> CreateGetter<TTarget, TValue>(Prop
837
837
/// indexer with at least one index parameter.</param>
838
838
/// <returns>A delegate that gets the value of the specified indexer property for a given declaringType object and index.</returns>
839
839
/// <exception cref="InvalidOperationException">Thrown if the specified property already has a getter invoker generated.</exception>
840
-
/// <exception cref="ArgumentException">Thrown if the specified property is not a 1D indexer, or is static, or if the types specified by <typeparamref name="TTarget"/>, <typeparamref name="TIndex"/>, or <typeparamref name="TValue"/> are not compatible with the declaring type, index parameter type, or property type.</exception>
840
+
/// <exception cref="ArgumentException">Thrown if the specified property is not an indexer, or is static, or if the types specified by <typeparamref name="TTarget"/>, <typeparamref name="TIndex"/>, or <typeparamref name="TValue"/> are not compatible with the declaring type, index parameter type, or property type.</exception>
841
841
/// <exception cref="ArgumentNullException">Thrown if <paramref name="propertyData"/> or its declaring type data is <see langword="null">.</exception>"
@@ -950,7 +951,7 @@ public static IndexerPropertyGetter<TTarget, TValue, TIndex> CreateIndexerGetter
950
951
/// indexer with exactly one index parameter.</param>
951
952
/// <returns>A delegate that gets the value of the specified static indexer property for a given declaringType object and index.</returns>
952
953
/// <exception cref="InvalidOperationException">Thrown if the specified property already has a getter invoker generated.</exception>
953
-
/// <exception cref="ArgumentException">Thrown if the specified property is not a 1D static indexer, or not static, or if the types specified by <typeparamref name="TIndex"/>, or <typeparamref name="TValue"/> are not compatible with the index parameter type, or property type.</exception>
954
+
/// <exception cref="ArgumentException">Thrown if the specified property is not an static indexer, or not static, or if the types specified by <typeparamref name="TIndex"/>, or <typeparamref name="TValue"/> are not compatible with the index parameter type, or property type.</exception>
954
955
/// <exception cref="ArgumentNullException">Thrown if <paramref name="propertyData"/> or its declaring type data is <see langword="null">.</exception>"
@@ -1803,7 +1804,7 @@ public static ValueTypePropertySetter<TTarget, TValue> CreateStructSetter<TTarge
1803
1804
/// <summary>
1804
1805
/// Creates a delegate that sets the value of a non-static indexer property on a reference type instance.
1805
1806
/// </summary>
1806
-
/// <remarks>Use this method to generate a performant setter for non-static 1D indexer properties when
1807
+
/// <remarks>Use this method to generate a performant setter for non-static indexer properties when
1807
1808
/// reflection-based property access is required.</remarks>
1808
1809
/// <typeparam name="TTarget">The reference type that declares the indexer property. Must be a class.</typeparam>
1809
1810
/// <typeparam name="TValue">The type of the value to set on the indexer property.</typeparam>
@@ -1812,7 +1813,7 @@ public static ValueTypePropertySetter<TTarget, TValue> CreateStructSetter<TTarge
1812
1813
/// <returns>A delegate that sets the value of the specified 3D indexer property on a reference type instance using the provided
1813
1814
/// indices and value type.</returns>
1814
1815
/// <exception cref="InvalidOperationException">Thrown if the specified property already has a set invoker generated.</exception>
1815
-
/// <exception cref="ArgumentException">Thrown if the property is declared on a value type,or is read-only, static, or if the provided generic method arguments are incompatible or if the property is not a 1D indexer.</exception>"
1816
+
/// <exception cref="ArgumentException">Thrown if the property is declared on a value type,or is read-only, static, or if the provided generic method arguments are incompatible or if the property is not a indexer.</exception>"
/// Creates a delegate that sets the value of a non-static indexer property on a reference type instance.
1919
1921
/// </summary>
1920
-
/// <remarks>Use this method to generate a performant setter for non-static 1D indexer properties when
1922
+
/// <remarks>Use this method to generate a performant setter for non-static indexer properties when
1921
1923
/// reflection-based property access is required.</remarks>
1922
1924
/// <typeparam name="TTarget">The reference type that declares the indexer property. Must be a class.</typeparam>
1923
1925
/// <typeparam name="TValue">The type of the value to set on the indexer property.</typeparam>
@@ -1926,7 +1928,7 @@ public static ValueTypePropertySetter<TTarget, TValue> CreateStructSetter<TTarge
1926
1928
/// <returns>A delegate that sets the value of the specified 3D indexer property on a reference type instance using the provided
1927
1929
/// indices and value type.</returns>
1928
1930
/// <exception cref="InvalidOperationException">Thrown if the specified property already has a set invoker generated.</exception>
1929
-
/// <exception cref="ArgumentException">Thrown if the property is read-only, static, or if the provided generic method arguments are incompatible or if the property is not a 1D indexer.</exception>"
1931
+
/// <exception cref="ArgumentException">Thrown if the property is read-only, static, or if the provided generic method arguments are incompatible or if the property is not an indexer.</exception>"
$"Type mismatch. Reason: The instance type {targetType.ToFullyQualifiedSignatureName()} is not assignable to {DeclaringTypeData.FullyQualifiedSignature}");
$"Type mismatch. Reason: The instance type {targetType.ToFullyQualifiedSignatureName()} is not assignable to {DeclaringTypeData.FullyQualifiedSignature}");
$"Type mismatch. Reason: The instance type {targetType.ToFullyQualifiedSignatureName()} is not assignable to {DeclaringTypeData.FullyQualifiedSignature}");
$"Type mismatch. Reason: The instance type {targetType.ToFullyQualifiedSignatureName()} is not assignable to {DeclaringTypeData.FullyQualifiedSignature}");
0 commit comments