Skip to content
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

Merge the latest draft-v8 into draft-v9 #1220

Open
wants to merge 164 commits into
base: draft-v9
Choose a base branch
from

Conversation

BillWagner
Copy link
Member

@BillWagner BillWagner commented Nov 21, 2024

We've been getting more work done.

DO NOT SQUASH THIS PR. WE WANT TO KEEP THE V8 HISTORY

BillWagner and others added 30 commits September 27, 2023 09:01
* Add a general sub-clause

In a recent PR, we broke apart local variable declarations into three different sections. When we did that, we created a clause that has both text and sub-clauses.

This PR fixes that.

I spoke offline with @RexJaeschke and he's making the appropriate edit to the Word doc for submission.

I'll cherry-pick this PR and the subsequent automated PR into `draft-v8` once this is merged.

* run section renumber locally

This will make it easier to cherry pick this once it's merged.
* Update v8-feature-tracker.md

* Update v8-feature-tracker.md

* Update v8-feature-tracker.md

* Update v8-feature-tracker.md
* Add issue template

Add the issue template for feedback from customers that read the specification on the docs.microsoft.com site.

Once this is merged, I can update the config to use this spec.

* add extra disclaimer

* Change article to document
* Generate the word doc as an artifact.

Add a workflow to generate the word doc and upload it as an artifact.

* updated deprecated commands.

`::set-output` is being deprecated. Replace it with `status=` syntax.

* Report status from converter run

* add an id

* YAML syntax

* reorder steps

* specify the shell

* path fixes

* remove unused array declaration

This isn't used by the tool, it reads all files in the folder, so just remove it.

Also, use the folder variable, rather than the hard-coded string.
* test for GITHUB_OUTPUT

When running locally, the environment variables set by GH actions aren't set. Check for their existence before writing to them.

* Add checks around all GITUB_OUTPUT

Check for the existence of the environment so our scripts don't fail when run locally.

* remove testing code.

* simplify

* fix syntax error

* respond to feedback

Because we're using `set -e`, we don't need to check the most recent error code before determining that it completed successfully.

* remove duplicate line
* Update clauses to separate unsafe code

For the grammar, we separate the unsafe code extensions. Make that distinction in the clauses.json, the code that reads it, and the section renumbering tool.

* Replicate current functionality

The section renumbering tool now replicates the output from the grammar extraction tool.

Refactoring to come.

* remove update grammar tool

It's no longer needed because it's functionality has been replicated in the section renumber tool.

* Refactoring, part 1

Simplify the loop that reads all the grammar productions from parts of the standard, and writes them to the grammar annex.

* refactoring, part 2

Read the existing text outside of the ANTLR productions from the existing annex.

That way, we can make any edits  to this text (including any changing section numbers) in the markdown file, rather than in the program source code.

* some final refactoring

* respond to feedback

* one final small lint fix
Fix for issue dotnet#787

The PR uses “corresponding parameter” rather than the “ith parameter" from dotnet#787. I think this is better, avoids HTML tags, and matches the use of corresponding parameter elsewhere; but either choice is valid.
* Update lexical-structure.md

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* fix editorial nits

* Update standard/expressions.md

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

* Apply suggestions from code review

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

* Update standard/expressions.md

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

* Update standard/expressions.md

---------

Co-authored-by: Bill Wagner <[email protected]>
Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
* reverse some V7 edits

* Update standard/classes.md

---------

Co-authored-by: Jon Skeet <[email protected]>
Fixes dotnet#987
Missing table part was just a production mishap.
Fixes the typo IFormatable -> IFormattable
* Upgrade .NET and NuGet packages

There were some breaking changes in the Word Converter packages. The only source code changes were to address the Word converter source breaks.

* interim checkin. Revert to 4.1.0

* Remove unnecessary usings, filespace using

Review this diff by hiding whitespace.

First, remove all unnecessary usings.
Second, convert all namespace declarations to file scoped namespaces.

* add editorconfig

This one is consistent with the version on dotnet/docs. We can season to taste as we're ready.

* Use the .NET 8 SDK for all our tools.

* Revert the grammar validator to .net 6

I've got a PR in that repo to update it. Once approved, I'll install the NuGet package here, and update that YML file.

* respond to review comments

- Update Roslyn packages to 4.8
- Remove coverlet
- Formatting in csproj.
Generic attributes will be valid in the future (and Roslyn knows
that), so the error code has changed.
Many of these are fixed with just pattern matching. I've been
liberal with the null-forgiving operator in the Word document code
itself, but most of the rest is fairly straightforward to handle
safely.

Fixes dotnet#998.
Fixes dotnet#938

Add an example of a type pattern to demonstrate when a pattern generates a compile-time error.
Fixes dotnet#937

I admit this rule confused me, and I asked to add the example.

After reading the updated, I'm ambivalent about adding the example. I don't want to move it into the bullet list, as that breaks the flow even more.

Let's discuss if it's needed at the meeting.
This already existed in the right place (in the list of argument
evaluation steps) but the example was associated with the duplicate.

Fixes dotnet#801.
dependabot bot and others added 24 commits October 2, 2024 15:44
)

Bumps the dotnet group with 1 update in the /tools directory: [xunit](https://github.com/xunit/xunit).


Updates `xunit` from 2.9.0 to 2.9.2
- [Commits](xunit/xunit@v2-2.9.0...v2-2.9.2)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dotnet
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Remove §10.3.8 on explicit dynamic conversions.

§10.2.10 already defines these conversions as *implicit* dynamic conversions. Therefore, none of these conversions would apply.

Remove references to the removed section.
* Add status checks to the test runner

Contributes to dotnet#1125

Replace the existing logging code with the utility class that writes to the console, and adds a status check record.

Log failures as status checks, but status is only to the output console.

* Update tools/Utilities/StatusCheckLogger.cs

* Apply suggestions from code review

* Feedback from code review

A bit of refactoring.
Bumps [System.Text.Json](https://github.com/dotnet/runtime) from 8.0.4 to 8.0.5.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](dotnet/runtime@v8.0.4...v8.0.5)

---
updated-dependencies:
- dependency-name: System.Text.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
* Port text from dotnet#700

The first commit ports in the text from dotnet#700 substantially without change. The only editorial change is to move the clause on "Nullable directives" in lexical-structure before the clause on Pragma directives.

* fix build warnings

This will likely cause new failures, as I turned on nullable annotations and warnings in one of the templates.

Update code samples for the template in use to remove nullable warnings.

I did this as we plan to have nullable annotations on by default in this version of the spec.

* Revert "fix build warnings"

This reverts commit dcb3731.

* test for nullable annotations

If the samples compile cleanly in this mode, I can continue in this PR without breaking all the samples.

* fix NRT grammar

* revert non-type changes.

* In progress draft

First draft at language for variations of nullability and reference types.

* Edit pass

* Apply suggestions from code review

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

* remove null-oblivious type

* a fair amount of cleanup

* fix build issues.

* fix preprocessor symbols and test messages

* one more warning fix.

* respond to feedback.

* respond to feedback.

* Apply suggestions from code review

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

* Notes for next updates

* fix warnings

* rebase and warnings

* word converter warnings

* word converter fx

* fix merge issues

* Updates from September meeting

At our September meeting, we decided that the standard should limit its normative text to the syntax required for nullable reference types, and a basic description explaining that the purpose of the annotations is to provide diagnostics.

* typo

* lint issue

* Add description of the `!` operator

This makes sense to add to this PR logically.

* null forgiveness can't be on array creation

I think this may fix the left recursion error as well. Even if it doesn't, it's still correct.

* Update for implicit declarations

State the nullable type for implicitly typed variables

* Apply suggestions from code review

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

* final updates from Oct 2nd meeting

Additional edits from comments at the Oct 2 meeting. This resolves all open concerns.

* Apply suggestions from code review

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

---------

Co-authored-by: Jon Skeet <[email protected]>
Co-authored-by: Nigel-Ecma <[email protected]>
Because we renumber sections, this isn't as useful as it once was.

And, it's not working correctly on our default branches. So, let's remove it.
* typo

* must-to-shall

* formatting nit

* formatting nit
7 times change `X` to `x`; 2 times remove "typically"
* Update Foreword for V8

* fix md
* improved text and rule names

* change section heading

* fix grammar edit error

* Update standard/statements.md

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

* Update standard/statements.md

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

* Update standard/statements.md

Co-authored-by: Kalle Olavi Niemitalo <[email protected]>

---------

Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: Kalle Olavi Niemitalo <[email protected]>
* Include attribute related text from dotnet#700

Include all the nullable analysis attributes in the spec. This will be edited heavily and shrunk down to a smaller set of normative text.

* update the section links

* First set of text updates

* fix first test run

* Update samples and descriptions

* fix final build warning

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* respond to feedback.

* Respond to feedback.

* fix tests

* Update attributes.md

* Apply suggestions from code review

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

* Don't imply unreachable code

When the `DoesNotReturn` attribute is parsed by a compiler that provides nullable diagnostics, that attribute can't impact reachable code analysis.

* Apply suggestions from code review

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

---------

Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
Co-authored-by: Neal Gafter <[email protected]>
Co-authored-by: Joseph Musser <[email protected]>
Bumps the dotnet group with 3 updates in the /tools directory: [System.Text.Json](https://github.com/dotnet/runtime), [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) and [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest).


Updates `System.Text.Json` from 8.0.5 to 9.0.0
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](dotnet/runtime@v8.0.5...v9.0.0)

Updates `Newtonsoft.Json` from 13.0.3 to 13.0.1
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@13.0.3...13.0.1)

Updates `Microsoft.NET.Test.Sdk` from 17.11.1 to 17.12.0
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.11.1...v17.12.0)

---
updated-dependencies:
- dependency-name: System.Text.Json
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dotnet
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dotnet
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dotnet
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* first pass at null-state examples.

* build warning

* Fix test build issues

* Respond to initial feedback

* warnings, not errors

* one more error tester fix

* Apply suggestions from code review

* Apply suggestions from code review

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

---------

Co-authored-by: Neal Gafter <[email protected]>
… in C# 8 (dotnet#1178)

* Incorporate some text from dotnet#700

Bring in the normative text from dotnet#700.

Some text is removed because of the decision on normative language in our September meeting.

* fix build issues

* Edit pass

* Respond to feedback.

* port grammar, part 1

* Update standard/types.md

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

* fix merge / rebase mishap

* Edits based on meeting feedback.

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* grammar fixes

* Apply suggestions from code review

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

* one last minor fix

* Rework description based on last meeting

Rework the description of nullable annotations on generic type parameters and generic type arguments.

We decided that these annotations should be specified in terms of only generating warnings, but never changing the semantics of a program.

* Use `nullable_type_attribute` in all type grammar

We'd used `'?'` and `nullable_type_attribute` in different places for the `?` annotation. Define `nullable_type_attribute` at first use, and use that consistently.

* Apply suggestions from code review

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

* small grammar fix

Offline comment from @Nigel-Ecma

* updates from 10/30 meeting

This covers part 1, the comments in the files tab

* address comments in converstation tab

This commit addresses the comments in the conversation tab from the 10/30 meeting.

* additional feedback

This commit incorporates the comments on the conversation tab.

* Apply suggestions from code review

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

* Replace nullable_type_attribute

with nullable_type_annotation

* typos

---------

Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
* Remove attributes

The `MemberNotNull` and `MemberNotNullWhen` attributes weren't available in C# 8. They were added in C# 9.

* fix build warnings

Missed two notes on these attributes
@BillWagner
Copy link
Member Author

Once this is merged, I'll create the PR to restore the MemberNotNull and MemberNotNullWhen attributes in C# 9

@jskeet
Copy link
Contributor

jskeet commented Nov 21, 2024

Is there anything specific you want me to review about this?

@BillWagner
Copy link
Member Author

Is there anything specific you want me to review about this?

@jskeet Just a quick sanity check. There were no conflicts when I did the merges, so it should be fine.

Copy link
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing really obvious springs to mind, but I haven't done significant checking.

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.