-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use in
for parameters and arguments
#22381
Comments
IMO counter intuitive and counterproductive. Pls respect developers past experience and education and do not break intuitive meaning of keywords. |
I also commented this here: #22387 (comment)
|
If we can chase useless dead-ends like a compiler switch for nullable references (what next, nullable nullables?), we can make provision to keep our CS teachers from having to tell students that ref readonly is the logical opposite of out. ref readonly tells you nothing of the direction that the readonly behavior applies; so much for the "intuitive meaning of keywords". Considering that this is C# and not [your forgotten dying prior language that you mysteriously aren't using anymore] we should use in as the exact opposite of out. C# uses in for the foreach statement and co/contra-variance, the latter of which most C# programmers have never heard or cared about. Therefore we have no "past experience and education" to break in the first place. |
Fixes #22381 - Use in for parameters and arguments
From LDM discussion today:
parameters should be declared with
in
instead ofref readonly
plain method call with consider both byval and
in
candidates, and continue producing an error if ambiguityin
at call site guarantees thein
candidate is picked and no copy is madeasync spilling should never make a copy if
in
(an error should be produced in this case)This bug is about part 1
Other parts are tracked in #22387
The text was updated successfully, but these errors were encountered: