Skip to content

Commit 37741bb

Browse files
BillWagnerjskeet
authored andcommitted
respond to feedback
1 parent 4f8255d commit 37741bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: standard/patterns.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ A *declaration_pattern* and a *var_pattern* can result in the declaration of a l
2222

2323
Each pattern form defines the set of types for input values that the pattern may be applied to. A pattern `P` is *applicable to* a type `T` if `T` is among the types whose values the pattern may match. It is a compile-time error if a pattern `P` appears in a program to match a pattern input value ([§11.1](patterns.md#111-general)) of type `T` if `P` is not applicable to `T`.
2424

25-
> *Example*: The following example generates a compile-time error because the compile-time type of `v` is `Stream`. A variable of type `Stream` can never be an expression of type `string`:
25+
> *Example*: The following example generates a compile-time error because the compile-time type of `v` is `Stream`. A variable of type `Stream` can never have a value that is reference compatible with `string`:
2626
>
2727
> ```csharp
2828
> Stream v = OpenDataFile(); // compile-time type of 'v' is 'Stream'
2929
> if (v is string) // compile-time error
3030
> {
31-
> /* code assuming v is a string*/
31+
> // code assuming v is a string
3232
> }
3333
> ```
3434
>
35-
> However, the following doesn't generate a compile-time error because the compile-time type of `v` is `object`. A variable of type `object` could be an expression of type `string`:
35+
> However, the following doesn't generate a compile-time error because the compile-time type of `v` is `object`. A variable of type `object` could have a value that is reference compatible with `string`:
3636
>
3737
> ```csharp
3838
> object v = OpenDataFile();
3939
> if (v is string s)
4040
> {
41-
> /* code assuming v is a string*/
41+
> // code assuming v is a string
4242
> }
4343
> ```
4444
>

0 commit comments

Comments
 (0)