Standardize list pattern lowering on Index constructor.#58055
Merged
AlekseyTs merged 4 commits intodotnet:mainfrom Dec 4, 2021
Merged
Standardize list pattern lowering on Index constructor.#58055AlekseyTs merged 4 commits intodotnet:mainfrom
Index constructor.#58055AlekseyTs merged 4 commits intodotnet:mainfrom
Conversation
Fixes dotnet#57825. Relevant spec adjustment dotnet/csharplang#5484.
Contributor
Author
Contributor
Author
|
@jcouv, @dotnet/roslyn-compiler For the second review. |
jcouv
reviewed
Dec 1, 2021
| } | ||
| else if (unloweredExpr is BoundObjectCreationExpression { Constructor: MethodSymbol constructor, Arguments: { Length: 2 } arguments, ArgsToParamsOpt: { IsDefaultOrEmpty: true }, InitializerExpressionOpt: null } && | ||
| (object)constructor == _compilation.GetWellKnownTypeMember(WellKnownMember.System_Index__ctor) && | ||
| arguments[0] is { Type.SpecialType: SpecialType.System_Int32, ConstantValue.Value: int _ and >= 0 } index && |
Member
jcouv
reviewed
Dec 1, 2021
| strategy = PatternIndexOffsetLoweringStrategy.UseAsIs; | ||
| return VisitExpression(operand); | ||
| } | ||
| else if (unloweredExpr is BoundObjectCreationExpression { Constructor: MethodSymbol constructor, Arguments: { Length: 2 } arguments, ArgsToParamsOpt: { IsDefaultOrEmpty: true }, InitializerExpressionOpt: null } && |
Member
Contributor
Author
There was a problem hiding this comment.
do we have a indexing test with an Index initialization with an initializer?
No, the type doesn't have any member that can be initialized, but I decided to have the check for completeness.
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Dec 6, 2021
…rovements * upstream/main: (68 commits) Lazy load ISourceLinkService to reduce DLL loads (dotnet#58108) [main] Update dependencies from dotnet/source-build (dotnet#57707) [main] Update dependencies from dotnet/arcade (dotnet#57968) Factor nullability logic for placeholders (dotnet#58036) Standardize list pattern lowering on `Index` constructor. (dotnet#58055) Add scripts to verify if a branch is ready to review Merge pull request dotnet#58100 from dotnet/dev/jorobich/skip-test Fix some places we weren't correctly disposing of VisualStudioAnalyzers Fix analyzer references being removed and added in one batch Fix indenting Ensure we don't silently capture any exceptions Don't MEF import the implementation directly if the public type will do Change comment Add comment Use actual jump tables Remove unused function Revert Simplify code Compute kind on demand Reorder ...
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.
Fixes #57825.
Relevant spec adjustment dotnet/csharplang#5484.
Relates to test plan: #51289