-
Notifications
You must be signed in to change notification settings - Fork 93
Description
In §12.2.2 we have:
- The value of a property access expression is obtained by invoking the get accessor of the property. If the property has no get accessor, a compile-time error occurs. Otherwise, a function member invocation (§12.6.6) is performed, and the result of the invocation becomes the value of the property access expression.
- The value of an indexer access expression is obtained by invoking the get accessor of the indexer. If the indexer has no get accessor, a compile-time error occurs. Otherwise, a function member invocation (§12.6.6) 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.
Both of these do not allow for a property or indexer with a ref get accessor – in such a case a compile-time error does not occur, a value is the result, etc.
Are ref get accessors classified as something other than property/indexer accesses somewhere?
Property access comes under member_reference, indexer under element_access, do these handle ref get and correctly classify the expression (§12.2), indeed does classification handle ref valued expressions correctly?
Then there is setting a property or indexer element (§12.21.2), is ref get handled correctly in these cases?
Above questions are not claimed to be exhaustive.
The above observations come from adding support for Index
and Range
(#1369, draft at time of writing) which has added text such as (§12.8.12.3 Indexer access in #1369):
An ancient (2018 ;-)) issue was raised in csharplang regarding ref get properties, transferred here as #295 years ago (2021 ;-)), and has no milestone…
This surely needs to be sorted for v8.