Skip to content

§15.10.1 Add note for purpose of in parameters in operators #845

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

Closed
jskeet opened this issue Jul 12, 2023 · 1 comment · Fixed by #1008
Closed

§15.10.1 Add note for purpose of in parameters in operators #845

jskeet opened this issue Jul 12, 2023 · 1 comment · Fixed by #1008
Assignees
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Milestone

Comments

@jskeet
Copy link
Contributor

jskeet commented Jul 12, 2023

#842 adds a fix so that operators can have in parameters. We might want to add a note to explain the purpose of this (to avoid copying large values) - but exactly where that should go (operators, or in parameters in general?) could take some discussion, so this is going to be post-v7.

@jskeet jskeet added the type: clarity While not technically incorrect, the Standard is potentially confusing label Jul 12, 2023
@jskeet jskeet changed the title Add note for purpose of in parameters in operators §15.10.1 Add note for purpose of in parameters in operators Jul 12, 2023
@jskeet jskeet added this to the Pre-C# 8.0 milestone Sep 21, 2023
@jskeet jskeet self-assigned this Oct 18, 2023
jskeet added a commit to jskeet/csharpstandard that referenced this issue Nov 23, 2023
Fixes dotnet#845.

I'm not at all convinced of the tone or precision of this - it's
effectively a straw man for further discussion.
@jskeet
Copy link
Contributor Author

jskeet commented Nov 23, 2023

This is the relevant paragraph:

The array co-variance rules (§17.6) permit a value of an array type A[] to be a reference to an instance of an array type B[], provided an implicit reference conversion exists from B to A. Because of these rules, when an array element of a reference_type is passed as an output or reference argument, a run-time check is required to ensure that the actual element type of the array is identical to that of the parameter.

jskeet added a commit that referenced this issue Nov 29, 2023
Fixes #845.

I'm not at all convinced of the tone or precision of this - it's
effectively a straw man for further discussion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant