You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standard/patterns.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -22,23 +22,23 @@ A *declaration_pattern* and a *var_pattern* can result in the declaration of a l
22
22
23
23
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`.
24
24
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`:
26
26
>
27
27
> ```csharp
28
28
>Streamv=OpenDataFile(); // compile-time type of 'v' is 'Stream'
29
29
>if (visstring) // compile-time error
30
30
> {
31
-
>/* code assuming v is a string*/
31
+
>// code assuming v is a string
32
32
> }
33
33
> ```
34
34
>
35
-
>However, thefollowingdoesn'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, thefollowingdoesn'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`:
0 commit comments