-
Notifications
You must be signed in to change notification settings - Fork 789
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
Treat { new Foo() }
as SynExpr.ObjExpr
#17388
Conversation
❗ Release notes required
|
SynExpr.ObjExpr
unification{ new Foo() }
as SynExpr.ObjExpr
52d6f93
to
bdc84e4
Compare
Naive question, how hard would it be to fix the problem in the parser, as in - stop parsing |
Yeah. That was first attempt(Update the parser and some how fix the described conflict here. But then realized the described rule conflict might out of date now that there are implicit yields. If an expression like So I think our best bet for now is to re-write during type checking like proposed in this PR. |
@vzarytovskii Do we also need to update the 9.0 release notes ? |
only 9.0.1xx, not 8.0.xxx as it's this time of the year when I locked the repo to bump version and change a bunch of defaults, so we can set up insertions in net9 only and bump TFM and language version |
Would love some feedback. Thanks |
@edgarfgp we've discussed this in the team briefly recently - the motivation of the PR is good here, we need to think if there is any better approach. This one is reasonable, just not traditional. If we cannot think of anything better, we can probably get this in like it is now. I understand this is a prior work and we appreciate you doing things in small chunks! That said, currently we are directing a lot of our time and energy into reviewing the nullness PR - we want to merge it ASAP to properly battletest it for .NET 9. You will help us a lot if you take a glance there also, since you've touched some of the code areas in your work :) |
Thanks @psfinaki. My approach here is similar to what @brianrourkeboll took in #17352 |
Right. In fact, if we updated the parser to treat |
This is a prior work to implement a lang suggestion see PR description. Let me know if this PR is clear or you need something else for me to address. |
3a23fe0
to
8a04c37
Compare
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Hey @edgarfgp, sorry this takes time, we were busy with nullness PR for a while. As for this PR, @T-Gro wanted to take a deep look but is off now for a few days. We keep track of this. I personally now cannot see any better way to do what you're trying to achieve and @brianrourkeboll's argumentation seems convincing to me. But please allow us some more time here. |
Patience is not passive, on the contrary, it is concentrated strength. Bruce Lee |
Head branch was pushed to by a user without write access
Description
I propose we unify
{ new Foo }
,{ new Foo() }
and{ New Foo with ... }
asSynExpr.ObjExpr
Before
fantomas tools
After
{ new Foo() }
will still be parsed asSynExpr.ComputationExpr
but instead we will re-write this toSynExpr.ObjExpr
e.g.Motivation
The above snippet reports 3 different errors.
After this PR it will only report 1 error.
Checklist