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

Test plan for "improved definite assignment" #51463

Closed
4 of 7 tasks
RikkiGibson opened this issue Feb 25, 2021 · 2 comments
Closed
4 of 7 tasks

Test plan for "improved definite assignment" #51463

RikkiGibson opened this issue Feb 25, 2021 · 2 comments

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Feb 25, 2021

Championed issue: dotnet/csharplang#4465
Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/improved-definite-assignment.md#specification

  • definite assignment and nullability improvements for ??
    • <null-conditional> ?? expr_second
  • definite assignment and nullability improvements for ? :
    • expr_cond ? expr_true : expr_false can result in conditional state
  • definite assignment and nullability improvements for ==
    • <null-conditional> == <null-constant>
    • <null-conditional> == <not-null>
    • expr == <constant-true>
    • expr == <constant-false>
    • corresponding rules for !=
    • predefined vs. user-defined == operators
    • DataFlowsOut API needs tests to demonstrate that the usage of Meet() between ==/!= operands is sound
  • definite assignment and nullability improvements for is
    • <null-conditional> is <not-null-only-matching-pattern>
    • <null-conditional> is <null-only-matching-pattern>
    • <null-conditional> is <true-only-matching-pattern>
    • <null-conditional> is <false-only-matching-pattern>
  • true, false operators

Needs some discussion:

  • definite assignment and nullability improvements for switch
  • definite assignment and nullability improvements for relational operators (>, ...)

Productivity

  • change x != null && x?.TryGetValue(out y) to x?.TryGetValue(out y) == true
@RikkiGibson RikkiGibson self-assigned this Feb 25, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 25, 2021
@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 3, 2021
@jcouv jcouv added this to the C# 10 milestone May 5, 2021
@RikkiGibson
Copy link
Contributor Author

We concluded that before feature merge, we will just get the nullable 'is' PR (#53311) merged, then another PR to ensure test coverage for the implemented aspects of the feature.

We intend to do the 'switch' and '<=' aspects in PRs to main after the feature is merged before shipping C# 10.

@jcouv
Copy link
Member

jcouv commented Sep 23, 2021

I think we can close this now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done Umbrellas
Development

No branches or pull requests

4 participants