@@ -57,16 +57,6 @@ array_type
57
57
: non_array_type rank_specifier+
58
58
;
59
59
60
- non_array_type
61
- : value_type
62
- | class_type
63
- | interface_type
64
- | delegate_type
65
- | 'dynamic'
66
- | type_parameter
67
- | pointer_type // unsafe code support
68
- ;
69
-
70
60
rank_specifier
71
61
: '[' ','* ']'
72
62
;
@@ -83,6 +73,28 @@ nullable_type_annotation
83
73
: '?'
84
74
;
85
75
76
+ non_array_type
77
+ : array_reference_type
78
+ | value_type
79
+ | type_parameter
80
+ | pointer_type // unsafe code support
81
+ ;
82
+
83
+ array_reference_type
84
+ : non_nullable_array_reference_type
85
+ | nullable_array_reference_type
86
+ ;
87
+
88
+ nullable_array_reference_type
89
+ : non_nullable_array_reference_type nullable_type_annotation
90
+ ;
91
+
92
+ non_nullable_array_reference_type
93
+ : class_type
94
+ | interface_type
95
+ | delegate_type
96
+ | 'dynamic'
97
+ ;
86
98
```
87
99
88
100
* pointer_type* is available only in unsafe code ([ §23.3] ( unsafe-code.md#233-pointer-types ) ). * nullable_reference_type* is discussed further in [ §8.9] ( types.md#89-reference-types-and-nullability ) .
@@ -201,11 +213,11 @@ floating_point_type
201
213
tuple_type
202
214
: '(' tuple_type_element (',' tuple_type_element)+ ')'
203
215
;
204
-
216
+
205
217
tuple_type_element
206
218
: type identifier?
207
219
;
208
-
220
+
209
221
enum_type
210
222
: type_name
211
223
;
@@ -327,7 +339,7 @@ C# supports nine integral types: `sbyte`, `byte`, `short`, `ushort`, `int`, `uin
327
339
- The `ulong ` type represents unsigned 64-bit integers with values from `0` to `18446744073709551615`, inclusive .
328
340
- The `char ` type represents unsigned 16-bit integers with values from `0` to `65535`, inclusive . The set of possible values for the `char ` type corresponds to the Unicode character set .
329
341
> *Note *: Although `char ` has the same representation as `ushort `, not all operations permitted on one type are permitted on the other . *end note *
330
-
342
+
331
343
All signed integral types are represented using two ’s complement format .
332
344
333
345
The *integral_type * unary and binary operators always operate with signed 32-bit precision , unsigned 32-bit precision , signed 64-bit precision , or unsigned 64-bit precision , as detailed in [§12.4.7](expressions .md #1247-numeric -promotions ).
@@ -539,7 +551,7 @@ type_argument_list
539
551
540
552
type_arguments
541
553
: type_argument (',' type_argument )*
542
- ;
554
+ ;
543
555
544
556
type_argument
545
557
: type
@@ -925,10 +937,10 @@ A compiler can update the null state of a variable as part of its analysis.
925
937
> int length = p .Length ; // Warning: p is maybe null
926
938
>
927
939
> string s = p ; // No warning. p is not null
928
- >
940
+ >
929
941
> if (s != null )
930
942
> {
931
- > int l2 = s .Length ; // No warning. s is not null
943
+ > int l2 = s .Length ; // No warning. s is not null
932
944
> }
933
945
> int l3 = s .Length ; // Warning. s is maybe null
934
946
> }
@@ -1031,11 +1043,11 @@ A compiler may use any expression that dereferences a variable, property, or eve
1031
1043
> public class C
1032
1044
> {
1033
1045
> private C ? child ;
1034
- >
1046
+ >
1035
1047
> public void M ()
1036
1048
> {
1037
1049
> _ = child .child .child ; // Warning. Dereference possible null value
1038
- > var greatGrandChild = child .child .child ; // No warning.
1050
+ > var greatGrandChild = child .child .child ; // No warning.
1039
1051
> }
1040
1052
> }
1041
1053
> ```
0 commit comments