Skip to content

Commit e9f09e3

Browse files
committed
docs
1 parent 775731b commit e9f09e3

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

api_list.include.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@
625625

626626
#### KeyValuePair
627627

628-
* `KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey, TValue)`
628+
* `KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey, TValue)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair.create)
629629

630630

631631
#### TaskCompletionSource

readme.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,20 +322,17 @@ public class OverloadResolutionPriorityAttributeTests
322322

323323
Reference: [Low Level Struct Improvements](https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/low-level-struct-improvements.md)
324324

325-
<!-- snippet: UnscopedRefUsage.cs -->
326-
<a id='snippet-UnscopedRefUsage.cs'></a>
325+
<!-- snippet: UnscopedRefUsage -->
326+
<a id='snippet-UnscopedRefUsage'></a>
327327
```cs
328-
using System.Diagnostics.CodeAnalysis;
329-
#pragma warning disable CS0169 // Field is never used
330-
331328
struct UnscopedRefUsage
332329
{
333330
int field1;
334331

335332
[UnscopedRef] ref int Prop1 => ref field1;
336333
}
337334
```
338-
<sup><a href='/src/Consume/UnscopedRefUsage.cs#L1-L9' title='Snippet source file'>snippet source</a> | <a href='#snippet-UnscopedRefUsage.cs' title='Start of snippet'>anchor</a></sup>
335+
<sup><a href='/src/Consume/UnscopedRefUsage.cs#L5-L12' title='Snippet source file'>snippet source</a> | <a href='#snippet-UnscopedRefUsage' title='Start of snippet'>anchor</a></sup>
339336
<!-- endSnippet -->
340337

341338

@@ -1079,7 +1076,7 @@ The class `Polyfill` includes the following extension methods:
10791076

10801077
#### KeyValuePair
10811078

1082-
* `KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey, TValue)`
1079+
* `KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey, TValue)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair.create)
10831080

10841081

10851082
#### TaskCompletionSource<!-- endInclude -->

src/Consume/Consume.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class Consume
8888
type = typeof(UnreachableException);
8989
type = typeof(DebuggerDisableUserUnhandledExceptionsAttribute);
9090

91+
KeyValuePair.Create("a", "b");
9192
// Test to make sure there are no clashes in the Polyfill code with classes that
9293
// might be defined in user code. See comments in Debug.cs for more details.
9394
Debug.Log("Test log to make sure this is working");

src/Consume/UnscopedRefUsage.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System.Diagnostics.CodeAnalysis;
22
#pragma warning disable CS0169 // Field is never used
33

4+
// ReSharper disable once ReplaceWithFieldKeyword
5+
#region UnscopedRefUsage
46
struct UnscopedRefUsage
57
{
6-
// ReSharper disable once ReplaceWithFieldKeyword
78
int field1;
89

910
[UnscopedRef] ref int Prop1 => ref field1;
10-
}
11+
}
12+
#endregion

src/Polyfill/KeyValuePair.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ namespace System.Collections.Generic;
1919
#endif
2020
static class KeyValuePair
2121
{
22-
// Creates a new KeyValuePair<TKey, TValue> from the given values.
22+
/// <summary>
23+
/// Creates a new key/value pair instance using provided values.
24+
/// </summary>
25+
/// <param name="key">The key of the new <see cref="KeyValuePair{TKey,TValue}"/> to be created.</param>
26+
/// <param name="value">The value of the new <see cref="KeyValuePair{TKey,TValue}"/> to be created.</param>
27+
/// <typeparam name="TKey">The type of the key.</typeparam>
28+
/// <typeparam name="TValue">The type of the value.</typeparam>
29+
/// <returns>A key/value pair containing the provided arguments as values.</returns>
30+
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keyvaluepair.create
2331
public static KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey key, TValue value) =>
2432
new KeyValuePair<TKey, TValue>(key, value);
2533
}

0 commit comments

Comments
 (0)