Skip to content

Commit 4a8c204

Browse files
authored
Extension-indexers: add placeholder spec (#9861)
1 parent 80f7e03 commit 4a8c204

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

proposals/extension-indexers.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Extension indexers
2+
3+
[!INCLUDE[Specletdisclaimer](../speclet-disclaimer.md)]
4+
5+
## Declaration
6+
7+
Like all extension members, extension indexers are declared within an extension block:
8+
9+
``` c#
10+
public static class Indexers
11+
{
12+
extension(int i)
13+
{
14+
public bool this[int bit] => ...;
15+
}
16+
}
17+
```
18+
19+
Extension indexers declarations generally follow the rules for
20+
non-extension [indexers in the Standard](https://github.com/dotnet/csharpstandard/blob/standard-v7/standard/classes.md#159-indexers).
21+

0 commit comments

Comments
 (0)