Skip to content

Merge v7 work #728

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

Merged
merged 140 commits into from
Jan 31, 2023
Merged

Merge v7 work #728

merged 140 commits into from
Jan 31, 2023

Conversation

BillWagner
Copy link
Member

Merge in updates for V7. This is a single merge commit that brings all the V7 updates into the draft-v8 working branch.

DON'T SQUASH MERGE THIS PR.

RexJaeschke and others added 30 commits August 8, 2022 07:54
Add C# 7 paragraph, convert C# 6 to "standard" from "draft"
* Fix typo

* Fix one more typo
Very rough and ready, and will need to be expanded (e.g. for expected exceptions) but it's enough to at least start a discussion.

Not yet tested on non-Windows platforms.
Co-authored-by: Bill Wagner <[email protected]>
Co-authored-by: Neal Gafter <[email protected]>
* Update statements.md

* Update unsafe-code.md

* Add semantics and example for local functions v7.0 feature

* removed local function unsafe grammar extension

With the consolidation of the unsafe grammar in PR dotnet#233, this text is no longer needed.

* include support for local functions

* add support for local functions

* fix build issues

* Apply suggestions from code review

Co-authored-by: KalleOlaviNiemitalo <[email protected]>

* clarify definite assignment, add examples

Addresses comments in committee meeting:

- dotnet#104 (comment)
- dotnet#104 (comment)

* respond to feedback.

* grammar updates

* Incorporate Andy's text

In this commit, create the new clause for the definite assignment rules for local functions. Move the existing example to that clause. Add text from Andy's comments and notes.

* finish local functions and definite assignment.

Incorporate the rules for definite assignment for captured variables in local functions. This is both for local function calls and for delegate conversion.

* typo

* Apply suggestions from code review

Co-authored-by: Nigel-Ecma <[email protected]>

* Apply suggestions from code review

* Update standard/statements.md

Co-authored-by: Jon Skeet <[email protected]>

* Update standard/statements.md

* Update standard/statements.md

Co-authored-by: Neal Gafter <[email protected]>

* Update standard/statements.md

* Update standard/statements.md

* edits based on September committee meeting

* fix link text

* fix section renumbering issue

* Final edits

We resolved these two discussions during the committee meeting. Edits reflect those decisions.

* updates from code review.

* one more bit of feedback.

Co-authored-by: Bill Wagner <[email protected]>
Co-authored-by: KalleOlaviNiemitalo <[email protected]>
Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
Co-authored-by: Neal Gafter <[email protected]>
We weren't running these validations when we merged changes into the draft-v7 branch.
* Update expressions.md

* build fixes

* Minor changes to bring this in line with the spec style and organization.

* Expression bodied member can be a throw expression.

* Add throw expression as a category into which an expression may be classified.

* Fix section number.

* fix merge error.

* add column end marker

* still rendering

* add one more escape

it appears that once any vertical bar is escaped in a table, they all must be.

* Add throw expressions to precedence table

* Move throw expression to a new top-level section after null coalescing operator

* Fix typo

* Update reference

* Update link to new section

Co-authored-by: Bill Wagner <[email protected]>

Co-authored-by: Bill Wagner <[email protected]>
Co-authored-by: Neal Gafter <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
Label `LABEL:` is not followed by a statement, and needs to be; null statement added
Enhanced 2xdelegate examples, so they are a better fit for the test harness
This allows the code to compile (as a single compilation unit, even though it's supposed to be in two separate compilation units).
The Color Color problem code needed a tiny change to avoid the ellipsis needing to return anything, but then it works.
This will allow for examples which are just statements.
(Also adds example in 16.1 Arrays to show how to use it.)

Towards dotnet#646
…dotnet#648)

Only the name (without the namespace) is specified; the FQN could be quite long-winded in the metadata.
Towards dotnet#646.
RexJaeschke and others added 25 commits January 11, 2023 10:57
* Correct/reformat example

* Correct/reformat example

* minor tweak

* fix errors in previous commit

* make minor tweaks

* add Point and Rectangle support files

I removed the redundant, hard-coded 1x`Point` and 2x`Rectangle` type declarations, replacing them with the following additions to the "additional-files" folder: Point.cs, Rectangle.cs, and RectangleWithConstructorPointAllocation.cs, and using the appropriate `additionalFiles:` in the examples' metadata.

* Create Point.cs

* Create Rectangle.cs

* Create RectangleWithConstructorPointAllocation.cs

* Apply fixes requested by Jon

* Fix nits found by Jon
* revise example metadata

* fix html comment formatting
* revise example metadata

* correct xml output
* revise example metadata

* Update classes.md

* fix md formatting
* Revise user guide

* mention limits on looking for console block
This allows the output to be ignored for nondeterministic or implementation-defined behavior.
* activate example extraction

* activate example extraction
* have example generate output

* minor tweak to example

* use new template code-in-partial-class

* Create Library.cs

* Create Project.csproj

* Create Caller.cs
In example PointerTypes1, the act of dereferencing `px1` and `px2` in `Main` is undefined. As such, the program might even abort! And even if the program executes, there is no point attempting to write out the underling `int` values, as they can be bogus, and certainly not predictable. (In my testing, *each* time I ran this program with output, one of the two values changed.)

So, I removed expectedOutput, changed the template, added some comments, and replaced the writes with dereferences to two new local variables.

For example PointerConversions1, I made no changes; I just activated this example.

For both examples, I added an HTML comment: `> <!-- Note: the behavior of this example is undefined. -->`.
* Make all example tests pass

(Currently 455 of them.)

* Reformat all examples
@BillWagner BillWagner merged commit 47912d4 into dotnet:draft-v8 Jan 31, 2023
@BillWagner BillWagner deleted the merge-v7-work branch January 31, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants