Move from calling Create to calling a specific constructor#53262
Merged
333fred merged 2 commits intodotnet:features/interpolated-stringfrom May 12, 2021
Merged
Move from calling Create to calling a specific constructor#53262333fred merged 2 commits intodotnet:features/interpolated-stringfrom
333fred merged 2 commits intodotnet:features/interpolated-stringfrom
Conversation
Member
Author
|
@chsienki @AlekseyTs for review. |
1 similar comment
Member
Author
|
@chsienki @AlekseyTs for review. |
Member
Author
|
@AlekseyTs for review. |
AlekseyTs
reviewed
May 12, 2021
| /// <summary> | ||
| /// Helper method to create a synthesized constructor invocation. | ||
| /// </summary> | ||
| private BoundExpression MakeClassCreationExpression( |
Contributor
There was a problem hiding this comment.
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
AlekseyTs
reviewed
May 12, 2021
| } | ||
|
|
||
| private BoundExpression MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, SyntaxNode typeSyntax, BindingDiagnosticBag diagnostics) | ||
| /// <param name="typeSyntax">If <paramref name="initializerOpt"/> is not null, this should not be null.</param> |
Contributor
AlekseyTs
reviewed
May 12, 2021
|
|
||
| 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); |
Contributor
Member
Author
There was a problem hiding this comment.
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.
AlekseyTs
reviewed
May 12, 2021
|
|
||
| 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); |
Contributor
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Couple of smaller changes: