-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Address test plan for target-typed new #29167
Address test plan for target-typed new #29167
Conversation
Please review #25196 before reviewing this. |
Binary operators are not wholly tested yet. Pending design decision on how we want them to behave. See #28489 (comment) |
0de6176
to
4319b86
Compare
Could you rebase please? I merged the previous PR, and for some reason those deltas are showing up here. |
4319b86
to
30507d5
Compare
So, I got a bit confused on tuples. Latest LDM notes say they should be allowed. Can you fix or add a Refers to: src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs:230 in 30507d5. [](commit_id = 30507d5, deletion_comment = False) |
nit: consider renaming Refers to: src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs:2279 in 30507d5. [](commit_id = 30507d5, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code change looks good (iteration 4). I'll finish reviewing the tests tomorrow. Thanks
If not already tested, another params scenario would be interesting: Thinking about array initializers, here's another idea: Refers to: src/Compilers/CSharp/Test/Semantic/Semantics/TargetTypedNewTests.cs:172 in 30507d5. [](commit_id = 30507d5, deletion_comment = False) |
// The old native compiler ignores ref/out in a delegate creation expression.
// For compatibility we implement the same bug except in strict mode.
// Note: Some others should still be rejected when ref/out present. See RefMustBeObeyed. Do we need to do this in new()? since it's for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. We'll turn the PROTOTYPE comments into an issue and deal with that separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks
@gafter for second sign-off. Thanks I'll close and re-open the PR to kick CI. |
I'll close and re-open the PR to kick CI. |
We'll need to refresh the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I attempted a merge from compilerNext and turns out I'll have to read the parser from the top. I noticed there's an assert to avoid lookaheads for new expressions,
@gafter do you intend to keep this for new() as well? iow with the new parser logic, do we still need lookaheads for this work? |
I don't recall the reason for the restriction/assertion. I believe the parser does require look-ahead for parsing types in patterns. |
Follow-up #25196
Test plan: #28489