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

Parameter default values should be accessible from bound nodes and/or symbols #47352

Closed
RikkiGibson opened this issue Sep 1, 2020 · 0 comments · Fixed by #49186
Closed

Parameter default values should be accessible from bound nodes and/or symbols #47352

RikkiGibson opened this issue Sep 1, 2020 · 0 comments · Fixed by #49186
Assignees
Labels
Area-Compilers Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality Feature - Nullable Reference Types Nullable Reference Types
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Sep 1, 2020

Related to #47171 (comment)

Basically, the "true" default values for optional parameters depend on a variety of factors, including the call site and attributes used on the parameter. Many of these factors aren't resolved until lowering of a call. It feels like nullable analysis among other things could be more accurate if the following changes were made:

  1. A BoundCall should contain child nodes for the implicitly passed default arguments. The constant values of those default arguments are the same as what we will produce during emit.
  2. A BoundMethodBody should contain child nodes for parameters with default values. This part of the design has been dropped. See https://github.com/dotnet/csharplang/blob/master/proposals/nullable-parameter-default-value-analysis.md

/cc @333fred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-Design Debt Engineering Debt, Design Debt, or poor product code quality Feature - Nullable Reference Types Nullable Reference Types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant