Skip to content

Commit 7a99c2d

Browse files
authored
Merge pull request #5010 from dotnet/master
Update live with current master
2 parents 6809156 + 5024b90 commit 7a99c2d

File tree

686 files changed

+962
-1105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

686 files changed

+962
-1105
lines changed

docs/csharp/deconstruct.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A tuple provides a light-weight way to retrieve multiple values from a method ca
1919

2020
Retrieving multiple field and property values from an object can be equally cumbersome: you have to assign a field or property value to a variable on a member-by-member basis.
2121

22-
Starting with C# 7, you can retrieve multiple elements from a tuple or retrieve multiple field, property, and computed values from an object in a single *deconstruct* operation. When you deconstruct a tuple, you assign its elements to individual variables. When you deconstruct an object, you assign selected values to individual variables.
22+
Starting with C# 7.0, you can retrieve multiple elements from a tuple or retrieve multiple field, property, and computed values from an object in a single *deconstruct* operation. When you deconstruct a tuple, you assign its elements to individual variables. When you deconstruct an object, you assign selected values to individual variables.
2323

2424
## Deconstructing a tuple
2525

@@ -58,7 +58,7 @@ Note that you cannot mix declarations and assignments to existing variables on t
5858

5959
## Deconstructing tuple elements with discards
6060

61-
Often when deconstructing a tuple, you're interested in the values of only some elements. Starting with C# 7, you can take advantage of C#'s support for *discards*, which are write-only variables whose values you've chosen to ignore. A discard is designated by an underscore character ("\_") in an assignment. You can discard as many values as you like; all are represented by the single discard, `_`.
61+
Often when deconstructing a tuple, you're interested in the values of only some elements. Starting with C# 7.0, you can take advantage of C#'s support for *discards*, which are write-only variables whose values you've chosen to ignore. A discard is designated by an underscore character ("\_") in an assignment. You can discard as many values as you like; all are represented by the single discard, `_`.
6262

6363
The following example illustrates the use of tuples with discards. The `QueryCityDataForYears` method returns a 6-tuple with the name of a city, its area, a year, the city's population for that year, a second year, and the city's population for that second year. The example shows the change in population between those two years. Of the data available from the tuple, we're unconcerned with the city area, and we know the city name and the two dates at design-time. As a result, we're only interested in the two population values stored in the tuple, and can handle its remaining values as discards.
6464

docs/csharp/discards.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ ms.devlang: csharp
1212
---
1313
# Discards - C# Guide
1414

15-
Starting with C# 7, C# supports discards, which are temporary, dummy variables that are intentionally unused in application code. Discards are equivalent to unassigned variables; they do not have a value. Because there is only a single discard variable, and that variable may not even be allocated storage, discards can reduce memory allocations. Because they make the intent of your code clear, they enhance its readability and maintainability.
15+
Starting with C# 7.0, C# supports discards, which are temporary, dummy variables that are intentionally unused in application code. Discards are equivalent to unassigned variables; they do not have a value. Because there is only a single discard variable, and that variable may not even be allocated storage, discards can reduce memory allocations. Because they make the intent of your code clear, they enhance its readability and maintainability.
1616

1717
You indicate that a variable is a discard by assigning it the underscore (`_`) as its name. For example, the following method call returns a 3-tuple in which the first and second values are discards and *area* is a previously declared variable to be set to the corresponding third component returned by *GetCityInformation*:
1818

1919
```csharp
2020
(_, _, area) = city.GetCityInformation(cityName);
2121
```
2222

23-
In C# 7, discards are supported in assignments in the following contexts:
23+
In C# 7.0, discards are supported in assignments in the following contexts:
2424

2525
- Tuple and object [deconstruction](deconstruct.md).
2626
- Pattern matching with [is](language-reference/keywords/is.md) and [switch](language-reference/keywords/switch.md).

docs/csharp/getting-started/introduction-to-the-csharp-language-and-the-net-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.author: "wiwagn"
1818
C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)]. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the [!INCLUDE[dnprdnshort](~/includes/dnprdnshort-md.md)].
1919

2020
> [!NOTE]
21-
> The [!INCLUDE[csprcs](~/includes/csprcs-md.md)] documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore [!INCLUDE[csprcsxpr](~/includes/csprcsxpr-md.md)], which is available on the Web. You can also take advantage of books and Web resources about C# to learn practical programming skills.
21+
> The [!INCLUDE[csprcs](~/includes/csprcs-md.md)] documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore Visual C# Express, which is available on the Web. You can also take advantage of books and Web resources about C# to learn practical programming skills.
2222
2323
## C# Language
2424
C# syntax is highly expressive, yet it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin to work productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ and provides powerful features such as nullable value types, enumerations, delegates, lambda expressions and direct memory access, which are not found in Java. C# supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code. [!INCLUDE[vbteclinqext](~/includes/vbteclinqext-md.md)] expressions make the strongly-typed query a first-class language construct.

docs/csharp/language-reference/compiler-options/win32manifest-compiler-option.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Use the **-win32manifest** option to specify a user-defined Win32 application ma
3030
The name and location of the custom manifest file.
3131

3232
## Remarks
33-
By default, the [!INCLUDE[csharp_current_short](~/includes/csharp-current-short-md.md)] compiler embeds an application manifest that specifies a requested execution level of "asInvoker." It creates the manifest in the same folder in which the executable is built, typically the bin\Debug or bin\Release folder when you use Visual Studio. If you want to supply a custom manifest, for example to specify a requested execution level of "highestAvailable" or "requireAdministrator," use this option to specify the name of the file.
33+
By default, the Visual C# compiler embeds an application manifest that specifies a requested execution level of "asInvoker." It creates the manifest in the same folder in which the executable is built, typically the bin\Debug or bin\Release folder when you use Visual Studio. If you want to supply a custom manifest, for example to specify a requested execution level of "highestAvailable" or "requireAdministrator," use this option to specify the name of the file.
3434

3535
> [!NOTE]
3636
> This option and the [-win32res (C# Compiler Options)](../../../csharp/language-reference/compiler-options/win32res-compiler-option.md) option are mutually exclusive. If you try to use both options in the same command line you will get a build error.

docs/csharp/language-reference/keywords/async.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ An async method can have the following return types:
7171
- <xref:System.Threading.Tasks.Task>
7272
- <xref:System.Threading.Tasks.Task%601>
7373
- [void](../../../csharp/language-reference/keywords/void.md), which should only be used for event handlers.
74-
- Starting with C# 7, any type that has an accessible `GetAwaiter` method. The `System.Threading.Tasks.ValueTask<TResult>` type is one such implementation. It is available by adding the NuGet package `System.Threading.Tasks.Extensions`.
74+
- Starting with C# 7.0, any type that has an accessible `GetAwaiter` method. The `System.Threading.Tasks.ValueTask<TResult>` type is one such implementation. It is available by adding the NuGet package `System.Threading.Tasks.Extensions`.
7575

7676
The async method can't declare any [in](../../../csharp/language-reference/keywords/in-parameter-modifier.md), [ref](../../../csharp/language-reference/keywords/ref.md) or [out](../../../csharp/language-reference/keywords/out-parameter-modifier.md) parameters, nor can it have a [reference return value](../../programming-guide/classes-and-structs/ref-returns.md), but it can call methods that have such parameters.
7777

7878
You specify `Task<TResult>` as the return type of an async method if the [return](../../../csharp/language-reference/keywords/return.md) statement of the method specifies an operand of type `TResult`. You use `Task` if no meaningful value is returned when the method is completed. That is, a call to the method returns a `Task`, but when the `Task` is completed, any `await` expression that's awaiting the `Task` evaluates to `void`.
7979

8080
You use the `void` return type primarily to define event handlers, which require that return type. The caller of a `void`-returning async method can't await it and can't catch exceptions that the method throws.
8181

82-
Starting with C# 7, you return another type, typically a value type, that has a `GetAwaiter` method to miminize memory allocations in performance-critical sections of code.
82+
Starting with C# 7.0, you return another type, typically a value type, that has a `GetAwaiter` method to miminize memory allocations in performance-critical sections of code.
8383

8484
For more information and examples, see [Async Return Types](../../../csharp/programming-guide/concepts/async/async-return-types.md).
8585

docs/csharp/language-reference/keywords/byte.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ms.author: "wiwagn"
2525

2626
## Literals
2727

28-
You can declare and initialize a `byte` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7) a binary literal to it. If the integer literal is outside the range of `byte` (that is, if it is less than <xref:System.Byte.MinValue?displayProperty=nameWithType> or greater than <xref:System.Byte.MaxValue?displayProperty=nameWithType>), a compilation error occurs.
28+
You can declare and initialize a `byte` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7.0) a binary literal to it. If the integer literal is outside the range of `byte` (that is, if it is less than <xref:System.Byte.MinValue?displayProperty=nameWithType> or greater than <xref:System.Byte.MaxValue?displayProperty=nameWithType>), a compilation error occurs.
2929

3030
In the following example, integers equal to 201 that are represented as decimal, hexadecimal, and binary literals are implicitly converted from [int](../../../csharp/language-reference/keywords/int.md) to `byte` values.
3131

@@ -34,7 +34,7 @@ In the following example, integers equal to 201 that are represented as decimal,
3434
> [!NOTE]
3535
> You use the prefix `0x` or `0X` to denote a hexadecimal literal and the prefix `0b` or `0B` to denote a binary literal. Decimal literals have no prefix.
3636
37-
Starting with C# 7, a couple of features have been added to enhance readability.
37+
Starting with C# 7.0, a couple of features have been added to enhance readability.
3838
- C# 7.0 allows the usage of the underscore character, `_`, as a digit separator.
3939
- C# 7.2 allows `_` to be used as a digit separator for a binary or hexadecimal literal, after the prefix. A decimal literal isn't permitted to have a leading underscore.
4040

docs/csharp/language-reference/keywords/get.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following example defines both a `get` and a `set` accessor for a property n
2323

2424
[!code-csharp[get#1](../../../../samples/snippets/csharp/language-reference/keywords/get/get-1.cs)]
2525

26-
Often, the `get` accessor consists of a single statement that returns a value, as it did in the previous example. Starting with C# 7, you can implement the `get` accessor as an expression-bodied member. The following example implements both the `get` and the `set` accessor as expression-bodied members.
26+
Often, the `get` accessor consists of a single statement that returns a value, as it did in the previous example. Starting with C# 7.0, you can implement the `get` accessor as an expression-bodied member. The following example implements both the `get` and the `set` accessor as expression-bodied members.
2727

2828
[!code-csharp[get#3](../../../../samples/snippets/csharp/language-reference/keywords/get/get-3.cs)]
2929

docs/csharp/language-reference/keywords/int.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ms.author: "wiwagn"
2525

2626
## Literals
2727

28-
You can declare and initialize an `int` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7) a binary literal to it. If the integer literal is outside the range of `int` (that is, if it is less than <xref:System.Int32.MinValue?displayProperty=nameWithType> or greater than <xref:System.Int32.MaxValue?displayProperty=nameWithType>), a compilation error occurs.
28+
You can declare and initialize an `int` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7.0) a binary literal to it. If the integer literal is outside the range of `int` (that is, if it is less than <xref:System.Int32.MinValue?displayProperty=nameWithType> or greater than <xref:System.Int32.MaxValue?displayProperty=nameWithType>), a compilation error occurs.
2929

3030
In the following example, integers equal to 90,946 that are represented as decimal, hexadecimal, and binary literals are assigned to `int` values.
3131

@@ -34,7 +34,7 @@ In the following example, integers equal to 90,946 that are represented as decim
3434
> [!NOTE]
3535
> You use the prefix `0x` or `0X` to denote a hexadecimal literal and the prefix `0b` or `0B` to denote a binary literal. Decimal literals have no prefix.
3636
37-
Starting with C# 7, a couple of features have been added to enhance readability.
37+
Starting with C# 7.0, a couple of features have been added to enhance readability.
3838
- C# 7.0 allows the usage of the underscore character, `_`, as a digit separator.
3939
- C# 7.2 allows `_` to be used as a digit separator for a binary or hexadecimal literal, after the prefix. A decimal literal isn't permitted to have a leading underscore.
4040

docs/csharp/language-reference/keywords/is.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.author: "wiwagn"
1818
---
1919
# is (C# Reference) #
2020

21-
Checks if an object is compatible with a given type, or (starting with C# 7) tests an expression against a pattern.
21+
Checks if an object is compatible with a given type, or (starting with C# 7.0) tests an expression against a pattern.
2222

2323
## Testing for type compatibility ##
2424

@@ -55,11 +55,11 @@ The `is` keyword generates a compile-time warning if the expression is known to
5555
`expr` can be any expression that returns a value, with the exception of anonymous methods and lambda expressions. The following example uses `is` to evaluate the return value of a method call.
5656
[!code-csharp[is#4](../../../../samples/snippets/csharp/language-reference/keywords/is/is4.cs#4)]
5757

58-
Starting with C# 7, you can use pattern matching with the [type pattern](#type) to write more concise code that uses the `is` statement.
58+
Starting with C# 7.0, you can use pattern matching with the [type pattern](#type) to write more concise code that uses the `is` statement.
5959

6060
## Pattern matching with `is` ##
6161

62-
Starting with C# 7, the `is` and [switch](../../../csharp/language-reference/keywords/switch.md) statements support pattern matching. The `is` keyword supports the following patterns:
62+
Starting with C# 7.0, the `is` and [switch](../../../csharp/language-reference/keywords/switch.md) statements support pattern matching. The `is` keyword supports the following patterns:
6363

6464
- [Type pattern](#type), which tests whether an expression can be converted to a specified type and, if it can be, casts it to a variable of that type.
6565

@@ -107,7 +107,7 @@ The equivalent code without pattern matching requires a separate assignment that
107107

108108
### <a name="constant" /> Constant pattern ###
109109

110-
When performing pattern matching with the constant pattern, `is` tests whether an expression equals a specified constant. In C# 6 and earlier versions, the constant pattern is supported by the [switch](switch.md) statement. Starting with C# 7, it is supported by the `is` statement as well. Its syntax is:
110+
When performing pattern matching with the constant pattern, `is` tests whether an expression equals a specified constant. In C# 6 and earlier versions, the constant pattern is supported by the [switch](switch.md) statement. Starting with C# 7.0, it is supported by the `is` statement as well. Its syntax is:
111111

112112
```csharp
113113
expr is constant

docs/csharp/language-reference/keywords/long.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ms.author: "wiwagn"
2525

2626
## Literals
2727

28-
You can declare and initialize a `long` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7) a binary literal to it.
28+
You can declare and initialize a `long` variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7.0) a binary literal to it.
2929

3030
In the following example, integers equal to 4,294,967,296 that are represented as decimal, hexadecimal, and binary literals are assigned to `long` values.
3131

@@ -34,7 +34,7 @@ In the following example, integers equal to 4,294,967,296 that are represented a
3434
> [!NOTE]
3535
> You use the prefix `0x` or `0X` to denote a hexadecimal literal and the prefix `0b` or `0B` to denote a binary literal. Decimal literals have no prefix.
3636
37-
Starting with C# 7, a couple of features have been added to enhance readability.
37+
Starting with C# 7.0, a couple of features have been added to enhance readability.
3838
- C# 7.0 allows the usage of the underscore character, `_`, as a digit separator.
3939
- C# 7.2 allows `_` to be used as a digit separator for a binary or hexadecimal literal, after the prefix. A decimal literal isn't permitted to have a leading underscore.
4040

0 commit comments

Comments
 (0)