Skip to content

Commit cebcdf8

Browse files
authored
Update csharp-14.md (#45907)
Fix indexer type in sample code
1 parent 772ec37 commit cebcdf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/whats-new/csharp-14.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static class Enumerable
3939
// Extension property:
4040
public bool IsEmpty => source.Any() == false;
4141
// Extension indexer:
42-
public int this[int index] => source.Skip(index).First();
42+
public TSource this[int index] => source.Skip(index).First();
4343

4444
// Extension method:
4545
public IEnumerable<TSource> Where(Func<TSource, bool> predicate) { ... }

0 commit comments

Comments
 (0)