-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove [EditorBrowsable(Never)] from [InlineArray], add XML docs (#94308
) * Remove [EditorBrowsable] from [InlineArray] * Add XML comments * Tweak XML docs following review comments Co-authored-by: Stephen Toub <stoub@microsoft.com> --------- Co-authored-by: Stephen Toub <stoub@microsoft.com>
- Loading branch information
1 parent
aac9923
commit 80666e8
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
22 changes: 19 additions & 3 deletions
22
...raries/System.Private.CoreLib/src/System/Runtime/CompilerServices/InlineArrayAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,38 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.ComponentModel; | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
/// <summary> | ||
/// Indicates that the instance's storage is sequentially replicated "length" times. | ||
/// </summary> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
/// <remarks> | ||
/// <para> | ||
/// This attribute can be used to annotate a <see langword="struct"/> type with a single field. | ||
/// The runtime will replicate that field in the actual type layout as many times as is specified. | ||
/// </para> | ||
/// <para> | ||
/// Here's an example of how an inline array type with 8 <see cref="float"/> values can be declared: | ||
/// <code lang="csharp"> | ||
/// [InlineArray(8)] | ||
/// struct Float8InlineArray | ||
/// { | ||
/// private float _value; | ||
/// } | ||
/// </code> | ||
/// </para> | ||
/// </remarks> | ||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] | ||
public sealed class InlineArrayAttribute : Attribute | ||
{ | ||
/// <summary>Creates a new <see cref="InlineArrayAttribute"/> instance with the specified length.</summary> | ||
/// <param name="length">The number of sequential fields to replicate in the inline array type.</param> | ||
public InlineArrayAttribute(int length) | ||
{ | ||
Length = length; | ||
} | ||
|
||
/// <summary>Gets the number of sequential fields to replicate in the inline array type.</summary> | ||
public int Length { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters