Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification 14 Expressions 14.1 Expression classifications 14.1.1 Values of expressions
Paragraph 11 Most of the constructs that involve an expression ultimately require the expression to denote a value. 2 In such cases, if the actual expression denotes a namespace, a type, a method group, or nothing, a compile-time error occurs. 3 However, if the expression denotes a property access, an indexer access, or a variable, the value of the property, indexer, or variable is implicitly substituted:
- 4 The value of a variable is simply the value currently stored in the storage location identified by the variable. 5 A variable must be considered definitely assigned (§12.3) before its value can be obtained, or otherwise a compile-time error occurs.
- 6 The value of a property access expression is obtained by invoking the get-accessor of the property. 7 If the property has no get-accessor, a compile-time error occurs. 8 Otherwise, a function member invocation (§14.4.3) is performed, and the result of the invocation becomes the value of the property access expression.
- 9 The value of an indexer access expression is obtained by invoking the get-accessor of the indexer. 10 If the indexer has no get-accessor, a compile-time error occurs. 11 Otherwise, a function member invocation (§14.4.3) is performed with the argument list associated with the indexer access expression, and the result of the invocation becomes the value of the indexer access expression.
|Jagger Software Ltd|
|Company # 4070126|
|VAT # 762 5213 42|