ECMA-334 C# Language Specification14.5: Primary expressions |
Primary expressions include the simplest forms of expressions.
array-creation-expression
primary-no-array-creation-expression
literal
simple-name
parenthesized-expression
member-access
invocation-expression
element-access
this-access
base-access
post-increment-expression
post-decrement-expression
object-creation-expression
delegate-creation-expression
typeof-expression
sizeof-expression
checked-expression
unchecked-expression
Primary expressions are divided between array-creation-expression
s and primary-no-array-creation-expression
s. Treating array-creation-expression
in this way, rather than listing it along with the other simple expression forms, enables the grammar to disallow potentially confusing code such as
object o = new int[3][1]; |
object o = (new int[3])[1]; |
In This Section: