- Notifications
You must be signed in to change notification settings - Fork4.2k
Move from calling Create to calling a specific constructor#53262
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Move from calling Create to calling a specific constructor#53262
Uh oh!
There was an error while loading.Please reload this page.
Conversation
333fred commentedMay 7, 2021
@chsienki@AlekseyTs for review. |
1 similar comment
333fred commentedMay 10, 2021
@chsienki@AlekseyTs for review. |
chsienki left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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
333fred commentedMay 11, 2021
@AlekseyTs for review. |
| /// <summary> | ||
| /// Helper method to create a synthesized constructor invocation. | ||
| /// </summary> | ||
| privateBoundExpressionMakeClassCreationExpression( |
AlekseyTsMay 12, 2021 • edited by 333fred
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by 333fred
Uh oh!
There was an error while loading.Please reload this page.
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.
The naming might be somewhat confusing. The helper isn't just for classes right? Structures are good too? You are probably follwong the pattern of BindClassCreationExpression name, however that function wasn't meant to be used as a general helper. Consider using name that simply indicates that an instance is created by using constructor. Then arguments start making more sense, etc. "MakeConstructorInvocation"? #Pending
| } | ||
| privateBoundExpressionMakeBadExpressionForObjectCreation(SyntaxNodenode,TypeSymboltype,AnalyzedArgumentsanalyzedArguments,InitializerExpressionSyntaxinitializerOpt,SyntaxNodetypeSyntax,BindingDiagnosticBagdiagnostics) | ||
| /// <param name="typeSyntax">If <paramref name="initializerOpt"/> is not null, this should not be null.</param> |
AlekseyTsMay 12, 2021 • edited by 333fred
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by 333fred
Uh oh!
There was an error while loading.Please reload this page.
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.
| BoundCall?createExpression=BindCreateCall(unconvertedInterpolatedString.Syntax,interpolatedStringBuilderType,arguments,diagnostics); | ||
| // PROTOTYPE(interp-string): Support optional out param for whether the builder was created successfully and passing in other required args | ||
| BoundExpression?createExpression=MakeClassCreationExpression(interpolatedStringBuilderType,arguments,unconvertedInterpolatedString.Syntax,diagnostics); |
AlekseyTsMay 12, 2021 • edited by 333fred
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by 333fred
Uh oh!
There was an error while loading.Please reload this page.
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.
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 have a prototype comment in LocalLowering to handle dynamic at a later point. I'll add assert for now that it either HasErrors or is a constructor.
| BoundCall?createExpression=BindCreateCall(unconvertedInterpolatedString.Syntax,interpolatedStringBuilderType,arguments,diagnostics); | ||
| // PROTOTYPE(interp-string): Support optional out param for whether the builder was created successfully and passing in other required args | ||
| BoundExpression?createExpression=MakeClassCreationExpression(interpolatedStringBuilderType,arguments,unconvertedInterpolatedString.Syntax,diagnostics); |
AlekseyTsMay 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
AlekseyTs left a comment
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 (commit 2)
333fred commentedMay 12, 2021
/azp run |
| Azure Pipelines successfully started running 3 pipeline(s). |
Uh oh!
There was an error while loading.Please reload this page.
Couple of smaller changes: