Tracking bug of smaller work items: - [x] turn this bug into a readme.md document for the feature. - [x] syntax model parsing - [x] more tests for syntax/parsing if necessary - [x] operators: should they be able to return by ref readonly? currently parser fails. - [x] binding right RefKind, some testing - [x] `in` parameters - [x] `ref readonly` parameters - [x] `ref readonly` returns. (make sure RefKind is not lost to become "ref", properties must not have setters though") - [x] public API and symbol display, - [x] default symbol display in error messages - [x] symbol display, possibly switch for "ref readonly"/"in" - [x] public API for returns finalized - [x] method body binding for parameters - [x] `in` parameters can be read - [x] diagnostics for readonly behavior - [x] Invoking methods with “in” parameters - [x] Assume only identity conversions, - [x] LValues only - [x] Support for RValues - [x] optimize temps - [x] Invalid error message on passing in parameters by ref (#18477) - [ ] More optimal codegen for indirect reading of readonly fields - [x] suppress copying when accessing readonly fields in "readonly ref" context - [x] suppress copying when accessing readonly fields to invoke readonly struct methods - [x] suppress copying when fetching a field off a readonly field typed as ordinary struct - [x] introduce a PEVerify-Compat flag for suppressing the above optimizations where possible. - [x] check the interop story - [x] F# - [x] VB - [x] C# older versions - [x] Write tests for native compilers (#19909) - [x] additional diagnostics for semantics of `in` parameters - [x] combine with various stuff - paramarrays, out, pointers, this, - [x] out/in attributes? - [x] use in expressions - recursive use of `in` parameters, dynamic, vararg, (the table of expr contexts?) - [x] enforce no capturing/spilling - [x] flow analysis - [x] regular scenarios - [x] region flow analysis - [x] OHI - [x] updating signature comparers to understand new RefKind (enough?) - [x] `in` and `none` are ambiguous at call sites. - [x] Operators? - [x] Ref return binding - [x] validate safe to return rule - [x] Lambda Inference (similar to `out` ?) - [x] Metadata - [x] finalize the design ( attributes or modifiers?) - [x] encoding - [x] decoding - [x] tests for broken metadata - [x] verifiable - [x] Enable EnC and EE scenarios for generating metadata (#19274) - [x] LDM Question: should compiler support importing ref-readonly abstract/virtual signatures from other assemblies that have the attribute, but not the modreq? (#19792) - [x] Passing readonly fields as `in` - [x] ensure that it works - [x] Object/ValueType methods that are not overridden can be called - [x] more readonly variables - iteration/using/query variables - [x] Readonly structs - [x] parsing - [x] binding - [x] Ref extension methods - [x] parsing - [x] binding - [x] unconstrained receiver types (ref readonly allowed?) - [x] Elvis operator in combination with ref/in extensions w/ structs/generics. (async too) - [x] Should Nullable types (structs) be allowed? - [x] Elvis operator on “readonly ref” - [x] IDE support - [x] keyword recommender should not interfere with typing - [x] Enable simple scenarios, block scenarios that do not work - [x] Debug EE. Is there any work? - [x] Mop up - [x] go through all uses of RefKind and check if anything needs to be done for readonly - [x] Expression trees - make sure we block what needs to be blocked - [x] Symbols should construct their own modifiers appropriately before looking into overridden symbols (#20053) - [x] Importing C# symbols with a modreq but a missing IsReadOnly attribute should mark it as a use-site error (#19951) - [x] Update compiler test plan (stackalloc, in, etc.)
Tracking bug of smaller work items:
turn this bug into a readme.md document for the feature.
syntax model parsing
binding right RefKind, some testing
inparametersref readonlyparametersref readonlyreturns. (make sure RefKind is not lost to become "ref", properties must not have setters though")public API and symbol display,
method body binding for parameters
inparameters can be readInvoking methods with “in” parameters
More optimal codegen for indirect reading of readonly fields
check the interop story
additional diagnostics for semantics of
inparametersinparameters, dynamic, vararg, (the table of expr contexts?)flow analysis
OHI
inandnoneare ambiguous at call sites.Operators?
Ref return binding
Lambda Inference (similar to
out?)Metadata
Passing readonly fields as
inReadonly structs
Ref extension methods
Elvis operator on “readonly ref”
IDE support
Debug EE. Is there any work?
Mop up