-
Notifications
You must be signed in to change notification settings - Fork 89
Add support for target typed conditional expression #1071
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
Draft
RexJaeschke
wants to merge
262
commits into
dotnet:draft-v9
Choose a base branch
from
RexJaeschke:Add-support-for-target-typed-conditional-expression
base: draft-v9
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add support for target typed conditional expression #1071
RexJaeschke
wants to merge
262
commits into
dotnet:draft-v9
from
RexJaeschke:Add-support-for-target-typed-conditional-expression
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: BillWagner <[email protected]>
* 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.
Co-authored-by: Bill Wagner <[email protected]>
Follow up to dotnet#1012
A note was duplicated (historically it was an in para note in v5, a standalone note in v6, and now in v7 is both – I'd blame git ;-))
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.
…atures Fixes dotnet#782. (I hadn't noticed that the same thing is relevant for indexers.)
* wordsmiting on return-by-ref Fixes dotnet#805 Clarify that return-by-ref expressions are evaluated the same as return-by-value expressions. The distinction is that for return-by-ref, the result must be a variable reference. * bonus typo fix * Update standard/statements.md Co-authored-by: Jon Skeet <[email protected]> --------- Co-authored-by: Jon Skeet <[email protected]>
* Link sections on `throw` and handling exceptions Fixes dotnet#776 Links are added in both directions between §21.4 and §13.10.6. * Update standard/exceptions.md Co-authored-by: Bill Wagner <[email protected]> --------- Co-authored-by: Mads Torgersen <[email protected]>
This clarifies that even NRE, DivideByZeroException etc counts as the exception being thrown.
Fixes dotnet#771 Add instances where the `<` and `>` characters are replaced by `{` and `}` in the string IDs.
Fixes dotnet#772 Single dimension arrays are encoded as "[]" rather than "[0]".
Fixes dotnet#915 In the example in D5, add the "name=" attribute on all param tags.
…5 -> v6 transition, and cleanup references
Co-authored-by: jskeet <[email protected]>
This minimizes a potential security attack vector.
Bumps the dotnet group in /tools with 2 updates: [Microsoft.Build.Locator](https://github.com/microsoft/MSBuildLocator) and XMLUnit.Core. Updates `Microsoft.Build.Locator` from 1.7.8 to 1.9.1 - [Release notes](https://github.com/microsoft/MSBuildLocator/releases) - [Commits](microsoft/MSBuildLocator@v1.7.8...v1.9.1) Updates `XMLUnit.Core` from 2.10.0 to 2.11.0 --- updated-dependencies: - dependency-name: Microsoft.Build.Locator dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dotnet - dependency-name: XMLUnit.Core 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>
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.11.0 to 2.11.1. - [Release notes](https://github.com/step-security/harden-runner/releases) - [Commits](step-security/harden-runner@4d991eb...c6295a6) --- updated-dependencies: - dependency-name: step-security/harden-runner dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: BillWagner <[email protected]>
Co-authored-by: Nigel-Ecma <[email protected]>
Fix a small typo noticed in the meeting
Co-authored-by: jskeet <[email protected]>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.3.0 to 4.4.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@cdca736...49933ea) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…up (dotnet#1306) Bumps the dotnet group in /tools with 1 update: [System.Text.Json](https://github.com/dotnet/runtime). Updates `System.Text.Json` from 9.0.3 to 9.0.4 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](dotnet/runtime@v9.0.3...v9.0.4) --- updated-dependencies: - dependency-name: System.Text.Json dependency-version: 9.0.4 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>
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.11.1 to 2.12.0. - [Release notes](https://github.com/step-security/harden-runner/releases) - [Commits](step-security/harden-runner@c6295a6...0634a26) --- updated-dependencies: - dependency-name: step-security/harden-runner dependency-version: 2.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Inline type_arguments into type_argument_list - Tidy global_attribute_section, attribute_section & attribute_list - Merge in updated samples & tarball - Includes updated declaration_expression predicate Co-authored-by: Nigel-Ecma <[email protected]>
Co-authored-by: BillWagner <[email protected]>
Co-authored-by: Jon Skeet <[email protected]>
Co-authored-by: jskeet <[email protected]>
…1324) Bumps the dotnet group in /tools with 1 update: [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit). Updates `xunit.runner.visualstudio` from 3.0.2 to 3.1.0 - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](xunit/visualstudio.xunit@3.0.2...3.1.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-version: 3.1.0 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>
…itional-expression
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
12.18 Conditional operator has an open issue; see the following words in that section: placeholder for words somehow referring to “12.6.4.5 Better conversion from expression.”
Here are the details:
Mail to Bill on 2024-03-18: The MS spec suggests the text for “12.6.4.5 Better conversion from expression” be augmented; OK. However, “12.18 Conditional operator“ does not reference that section; instead, it points to “12.6.3.15 Finding the best common type of a set of expressions.” So, I don’t see how the proposed changes to “better conversion” will be seen in the context of “best common type.” Unless these two are somehow linked and I’m not seeing where.
Bill’s reply on 2024-04-01: I think the conditional expression section should reference both sections, as sometimes the conditional expression applies when there is no best common type.