Skip to content

Commit 3ff9b7f

Browse files
authored
Corrected runtime to run-time (#23920)
1 parent 9728c8c commit 3ff9b7f

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

docs/csharp/language-reference/operators/equality-operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ That is a case-sensitive ordinal comparison. For more information about string c
6565

6666
### Delegate equality
6767

68-
Two [delegate](../../programming-guide/delegates/index.md) operands of the same runtime type are equal when both of them are `null` or their invocation lists are of the same length and have equal entries in each position:
68+
Two [delegate](../../programming-guide/delegates/index.md) operands of the same run-time type are equal when both of them are `null` or their invocation lists are of the same length and have equal entries in each position:
6969

7070
[!code-csharp-interactive[delegate equality](snippets/shared/EqualityOperators.cs#DelegateEquality)]
7171

docs/csharp/language-reference/operators/patterns.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ C# introduced pattern matching in C# 7.0. Since then, each major C# version exte
2222

2323
In those constructs, you can match an input expression against any of the following patterns:
2424

25-
- [Declaration pattern](#declaration-and-type-patterns): to check the runtime type of an expression and, if a match succeeds, assign an expression result to a declared variable. Introduced in C# 7.0.
26-
- [Type pattern](#declaration-and-type-patterns): to check the runtime type of an expression. Introduced in C# 9.0.
25+
- [Declaration pattern](#declaration-and-type-patterns): to check the run-time type of an expression and, if a match succeeds, assign an expression result to a declared variable. Introduced in C# 7.0.
26+
- [Type pattern](#declaration-and-type-patterns): to check the run-time type of an expression. Introduced in C# 9.0.
2727
- [Constant pattern](#constant-pattern): to test if an expression result equals a specified constant. Introduced in C# 7.0.
2828
- [Relational patterns](#relational-patterns): to compare an expression result with a specified constant. Introduced in C# 9.0.
2929
- [Logical patterns](#logical-patterns): to test if an expression matches a logical combination of patterns. Introduced in C# 9.0.
@@ -38,23 +38,23 @@ For the example of how to use those patterns to build a data-driven algorithm, s
3838

3939
## Declaration and type patterns
4040

41-
You use declaration and type patterns to check if the runtime type of an expression is compatible with a given type. With a declaration pattern, you can also declare a new local variable. When a declaration pattern matches an expression, that variable is assigned a converted expression result, as the following example shows:
41+
You use declaration and type patterns to check if the run-time type of an expression is compatible with a given type. With a declaration pattern, you can also declare a new local variable. When a declaration pattern matches an expression, that variable is assigned a converted expression result, as the following example shows:
4242

4343
:::code language="csharp" source="snippets/patterns/DeclarationAndTypePatterns.cs" id="BasicExample":::
4444

4545
Beginning with C# 7.0, a *declaration pattern* with type `T` matches an expression when an expression result is non-null and any of the following conditions are true:
4646

47-
- The runtime type of an expression result is `T`.
47+
- The run-time type of an expression result is `T`.
4848

49-
- The runtime type of an expression result derives from type `T` or implements interface `T` or another [implicit reference conversion](~/_csharplang/spec/conversions.md#implicit-reference-conversions) exists from it to `T`. The following example demonstrates two cases when this condition is true:
49+
- The run-time type of an expression result derives from type `T`, implements interface `T`, or another [implicit reference conversion](~/_csharplang/spec/conversions.md#implicit-reference-conversions) exists from it to `T`. The following example demonstrates two cases when this condition is true:
5050

5151
:::code language="csharp" source="snippets/patterns/DeclarationAndTypePatterns.cs" id="ReferenceConversion":::
5252

53-
In the preceding example, at the first call to the `GetSourceLabel` method, the first pattern matches an argument value because the argument's runtime type `int[]` derives from the <xref:System.Array> type. At the second call to the `GetSourceLabel` method, the argument's runtime type <xref:System.Collections.Generic.List%601> doesn't derive from the <xref:System.Array> type but implements the <xref:System.Collections.Generic.ICollection%601> interface.
53+
In the preceding example, at the first call to the `GetSourceLabel` method, the first pattern matches an argument value because the argument's run-time type `int[]` derives from the <xref:System.Array> type. At the second call to the `GetSourceLabel` method, the argument's run-time type <xref:System.Collections.Generic.List%601> doesn't derive from the <xref:System.Array> type but implements the <xref:System.Collections.Generic.ICollection%601> interface.
5454

55-
- The runtime type of an expression result is a [nullable value type](../builtin-types/nullable-value-types.md) with the underlying type `T`.
55+
- The run-time type of an expression result is a [nullable value type](../builtin-types/nullable-value-types.md) with the underlying type `T`.
5656

57-
- A [boxing](../../programming-guide/types/boxing-and-unboxing.md#boxing) or [unboxing](../../programming-guide/types/boxing-and-unboxing.md#unboxing) conversion exists from the runtime type of an expression result to type `T`.
57+
- A [boxing](../../programming-guide/types/boxing-and-unboxing.md#boxing) or [unboxing](../../programming-guide/types/boxing-and-unboxing.md#unboxing) conversion exists from the run-time type of an expression result to type `T`.
5858

5959
The following example demonstrates the last two conditions:
6060

@@ -68,7 +68,7 @@ Beginning with C# 9.0, for that purpose you can use a *type pattern*, as the fol
6868

6969
:::code language="csharp" source="snippets/patterns/DeclarationAndTypePatterns.cs" id="TypePattern":::
7070

71-
Like a declaration pattern, a type pattern matches an expression when an expression result is non-null and its runtime type satisfies any of the conditions listed above.
71+
Like a declaration pattern, a type pattern matches an expression when an expression result is non-null and its run-time type satisfies any of the conditions listed above.
7272

7373
For more information, see the [Declaration pattern](~/_csharplang/proposals/csharp-8.0/patterns.md#declaration-pattern) and [Type pattern](~/_csharplang/proposals/csharp-9.0/patterns3.md#type-patterns) sections of the feature proposal notes.
7474

@@ -150,7 +150,7 @@ Beginning with C# 8.0, you use a *property pattern* to match an expression's pro
150150

151151
A property pattern matches an expression when an expression result is non-null and every nested pattern matches the corresponding property or field of the expression result.
152152

153-
You can also add a runtime type check and a variable declaration to a property pattern, as the following example shows:
153+
You can also add a run-time type check and a variable declaration to a property pattern, as the following example shows:
154154

155155
:::code language="csharp" source="snippets/patterns/PropertyPattern.cs" id="WithTypeCheck":::
156156

@@ -180,7 +180,7 @@ You can use the names of tuple elements and `Deconstruct` parameters in a positi
180180

181181
You can also extend a positional pattern in any of the following ways:
182182

183-
- Add a runtime type check and a variable declaration, as the following example shows:
183+
- Add a run-time type check and a variable declaration, as the following example shows:
184184

185185
:::code language="csharp" source="snippets/patterns/PositionalPattern.cs" id="WithTypeCheck":::
186186

docs/csharp/language-reference/operators/type-testing-and-cast.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ helpviewer_keywords:
2525

2626
You can use the following operators and expressions to perform type checking or type conversion:
2727

28-
- [is operator](#is-operator): to check if the runtime type of an expression is compatible with a given type
29-
- [as operator](#as-operator): to explicitly convert an expression to a given type if its runtime type is compatible with that type
28+
- [is operator](#is-operator): to check if the run-time type of an expression is compatible with a given type
29+
- [as operator](#as-operator): to explicitly convert an expression to a given type if its run-time type is compatible with that type
3030
- [cast expression](#cast-expression): to perform an explicit conversion
3131
- [typeof operator](#typeof-operator): to obtain the <xref:System.Type?displayProperty=nameWithType> instance for a type
3232

3333
## is operator
3434

35-
The `is` operator checks if the runtime type of an expression result is compatible with a given type. Beginning with C# 7.0, the `is` operator also tests an expression result against a pattern.
35+
The `is` operator checks if the run-time type of an expression result is compatible with a given type. Beginning with C# 7.0, the `is` operator also tests an expression result against a pattern.
3636

3737
The expression with the type-testing `is` operator has the following form
3838

@@ -66,7 +66,7 @@ For information about C# conversions, see the [Conversions](~/_csharplang/spec/c
6666

6767
### Type testing with pattern matching
6868

69-
Beginning with C# 7.0, the `is` operator also tests an expression result against a pattern. The following example shows how to use a [declaration pattern](patterns.md#declaration-and-type-patterns) to check the runtime type of an expression:
69+
Beginning with C# 7.0, the `is` operator also tests an expression result against a pattern. The following example shows how to use a [declaration pattern](patterns.md#declaration-and-type-patterns) to check the run-time type of an expression:
7070

7171
[!code-csharp-interactive[is with declaration pattern](snippets/shared/TypeTestingAndConversionOperators.cs#IsDeclarationPattern)]
7272

@@ -125,11 +125,11 @@ You can also use the `typeof` operator with unbound generic types. The name of a
125125

126126
[!code-csharp-interactive[typeof unbound generic](snippets/shared/TypeTestingAndConversionOperators.cs#TypeOfUnboundGeneric)]
127127

128-
An expression cannot be an argument of the `typeof` operator. To get the <xref:System.Type?displayProperty=nameWithType> instance for the runtime type of an expression result, use the <xref:System.Object.GetType%2A?displayProperty=nameWithType> method.
128+
An expression cannot be an argument of the `typeof` operator. To get the <xref:System.Type?displayProperty=nameWithType> instance for the run-time type of an expression result, use the <xref:System.Object.GetType%2A?displayProperty=nameWithType> method.
129129

130130
### Type testing with the `typeof` operator
131131

132-
Use the `typeof` operator to check if the runtime type of the expression result exactly matches a given type. The following example demonstrates the difference between type checking performed with the `typeof` operator and the [is operator](#is-operator):
132+
Use the `typeof` operator to check if the run-time type of the expression result exactly matches a given type. The following example demonstrates the difference between type checking performed with the `typeof` operator and the [is operator](#is-operator):
133133

134134
[!code-csharp[typeof vs is](snippets/shared/TypeTestingAndConversionOperators.cs#TypeCheckWithTypeOf)]
135135

docs/csharp/language-reference/operators/with-expression.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Available in C# 9.0 and later, a `with` expression produces a copy of its [recor
1616

1717
As the preceding example shows, you use [object initializer](../../programming-guide/classes-and-structs/object-and-collection-initializers.md) syntax to specify what members to modify and their new values. In a `with` expression, a left-hand operand must be of a record type.
1818

19-
The result of a `with` expression has the same runtime type as the expression's operand, as the following example shows:
19+
The result of a `with` expression has the same run-time type as the expression's operand, as the following example shows:
2020

2121
:::code language="csharp" source="snippets/with-expression/InheritanceExample.cs" :::
2222

0 commit comments

Comments
 (0)