-
Notifications
You must be signed in to change notification settings - Fork 6k
add what's new in 7.2 #3672
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
add what's new in 7.2 #3672
Conversation
This is ready for review. /cc @jcouv |
docs/csharp/whats-new/csharp-7-2.md
Outdated
- The `readonly struct` declaration indicates that a struct is immutable and should be passed as an `in` parameter to its members methods. | ||
- The `ref struct` declaration indicates that a struct type accesses managed memory directly and must always be stack allocated. | ||
|
||
You can read more about all these changes in [Using value types with reference semantics](../ref-locals-and-returns.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is broken, or maybe not published yet. The URL worries me, as it seems to refer to the C# 7.0 feature ("ref locals and returns").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not published. It's in #3667
Good point on the link. I'll update it in the other PR once I have reviews on it.
LGTM Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A number of comments and suggestions, @BillWagner.
docs/csharp/whats-new/csharp-7-2.md
Outdated
One theme for this release is working more efficiently with value types by | ||
avoiding unnecessary copies or allocations. | ||
|
||
The remaining features are small, nice to have features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: nice to have --> nice-to-have
docs/csharp/whats-new/csharp-7-2.md
Outdated
* [Non-trailing named arguments](#non-trailing-named-arguments) | ||
- Named arguments can be followed by positional arguments. | ||
* [Leading underscores in numeric literals](#leading-underscores-in-numeric-literals) | ||
- Number literals can now have leading underscores before any printed digits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Number --> Numeric
docs/csharp/whats-new/csharp-7-2.md
Outdated
## Reference semantics with value types | ||
|
||
Language features introduced in 7.2 enable scenarios | ||
for working with value types while using reference semantics. These features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This first sentence is difficult to parse. Perhaps:
enable scenarios for working with value types --> let you work with value types
These features --> They
docs/csharp/whats-new/csharp-7-2.md
Outdated
|
||
Language features introduced in 7.2 enable scenarios | ||
for working with value types while using reference semantics. These features | ||
are designed to increase performance by minimize copying value types without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimize --> minimizing
docs/csharp/whats-new/csharp-7-2.md
Outdated
incurring the memory allocations associated with using reference types. The | ||
features include: | ||
|
||
- The `in` modifier on parameters to specify that an argument is passed by reference, but not modified by the called method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four features should be parallel in structure. I personally like the format of the first one (, to , So my comments will assume all four will follow that format, but you could also make the in
modifier conform to the other three.
comma after parameters, and no comma before but
docs/csharp/whats-new/csharp-7-2.md
Outdated
|
||
## Leading underscores in numeric literals | ||
|
||
The first implementation of allowing `_` characters in numeric literals did not allow the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"of allowing _
characters in numeric literals" is not a good description. I'd change it to "The first implementation of support for digit separators in numeric literals...". Or mention 7.0 -- "The implementation of support for digit separators in C# 7.0 did not allow..."
docs/csharp/whats-new/csharp-7-2.md
Outdated
## Leading underscores in numeric literals | ||
|
||
The first implementation of allowing `_` characters in numeric literals did not allow the | ||
`_` to be the first character of the literal value. Numeric |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all numeric literals, but only binary and hex, no?
docs/csharp/whats-new/csharp-7-2.md
Outdated
|
||
## `private protected` | ||
|
||
Finally, a new compound access modifier: `private protected`, indicates that a member may be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you keep the colon, no comma after private protected
. If you keep the comma after private protected
, change the colon to a comma.
docs/csharp/whats-new/csharp-7-2.md
Outdated
## `private protected` | ||
|
||
Finally, a new compound access modifier: `private protected`, indicates that a member may be | ||
accessed by derived classes that are declared in the same assembly. Where `protected internal` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where --> While
docs/csharp/whats-new/csharp-7-2.md
Outdated
|
||
Finally, a new compound access modifier: `private protected`, indicates that a member may be | ||
accessed by derived classes that are declared in the same assembly. Where `protected internal` | ||
access allows access by derived classes or classes that are in the same assembly, `private protected` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first occurrence of "access" here can be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some minor comments in addition to the ones already made by @rpetrusha
docs/csharp/whats-new/csharp-7-2.md
Outdated
|
||
## Leading underscores in numeric literals | ||
|
||
The first implementation of allowing `_` characters in numeric literals did not allow the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @rpetrusha. Also use contractions: did not allow -> didn't allow
docs/csharp/whats-new/csharp-7-2.md
Outdated
features include: | ||
|
||
- The `in` modifier on parameters to specify that an argument is passed by reference, but not modified by the called method. | ||
- The `ref readonly` modifier on method returns indicates that a method returns its value by reference but does not allow writes to that object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: does not -> doesn't
docs/csharp/whats-new/csharp-7-2.md
Outdated
## Non-trailing named arguments | ||
|
||
Method calls may now use named arguments that precede positional arguments when those | ||
named arguments are in the correct positions. Read more in the updated content for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably stick with the boilerplate sentence here. For more information, see ...
docs/csharp/whats-new/csharp-7-2.md
Outdated
access allows access by derived classes or classes that are in the same assembly, `private protected` | ||
limits access to derived types declared in the same assembly. | ||
|
||
You can read more of the details in the language reference article on [access modifiers](../language-reference/keywords/access-modifiers.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again I'd probably stick with the boilerplate here.
Updated based on feedback. @mairaw @rpetrusha Can you take a look? |
LGTM, @BillWagner. The build is still in progress, but you can merge once the build finishes and it looks good. |
Closing and reopening to force a build (to check a link) |
* add what's new in 7.2 * prrofread and update * respond to feedback. * update referenced file name
Create the "What's new in C# 7.2 topic.