Property & indexer access not fully updated for ref get accessors
@jskeet is already working on this.
Since Apr 9, 2026.
Assessment
This issue has not been assessed yet.
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.
- Dominant language
- C#
- Stars
- 815
- Forks
- 99
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/csharpstandard
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dotnet/csharpstandard#1629 ·
-
type: clarity
Difficulty 1/5 Under an hour Newbie friendliness 82/100
dotnet/csharpstandard#599 ·
-
9.3.6 Char set Opentype: clarity
Difficulty 1/5 Under an hour Newbie friendliness 68/100
dotnet/csharpstandard#189 · 5 comments ·
-
dotnet/csharpstandard#1805 · 1 assignee ·
-
dotnet/csharpstandard#1803 · 2 comments · 1 assignee ·
All issues in dotnet/csharpstandard
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·