-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Merge main
branch into list-patterns
branch
#57425
Conversation
Use Roslyn.sln, not Compilers.sln, to build more projects during source-build. Update ExcludeFromSourceBuild properties to include more projects and exclude a few projects that shouldn't be in source-build. The newly included projects are used by downstream repos.
This makes source-build stop producing the Microsoft.CodeAnalysis.Collections package. Downstream repos (MSBuild) can't safely use a source-built version.
By default, the projects reference Microsoft.Build 16.5.0, which has netcoreapp2.1 and net472 support. The new 17.0.0-... version built during source-build only has net6.0. This causes Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj to fail. Adding 16.5.0 to SBRP and dodging the override by renaming each package version property is the safe way to fix it.
Checks that do not depend on |
We're doing just that.
There's no earlier place that we could check those at the same time. |
When we enter this case, where do we check that Refers to: src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs:1376 in 362472f. [](commit_id = 362472f, deletion_comment = False) |
Line 1384 (notice we're depending on the Source) roslyn/src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs Lines 1379 to 1384 in 90ee5ef
|
This line checks different inputs, note that lines 1379 and 1380 overwrite values in |
I think you mean we put the entire switch in |
That would change the behavior though which is against well-behaved assumption from spec. If Slice on the outer list returns a different type from Slice on the inner list, we no longer consider those related with this check. |
I think the type check will be inappropriate here as well.
I prefer us to not rely on assumptions like that, even if they are valid assumptions today. An approach like that is not robust in the long term should BoundDagTemp evolve. The "equivalence" of inputs that doesn't depend on their sources, should be checked before we do anything with sources. |
Note, that the change that you are merging is sayin that "equivalence" of inputs doesn't require equality of types by default. Equality of types is required when types are indeed important. The merge doesn't preserve this principle and I think it should be preserved. |
That would work (different Slice return types will be ignored) but I'm not sure what does that entail for the rest of usages of IsEquivalentTo. It's possible we will need another helper for those. |
I do not believe I suggested to simply make changes to In reply to: 954040600 |
Is there an advantage to do this check, which potentially does a very deep check on every iteration) instead of simply letting the loop to descend one step at a time and handle reaching null source on either or both sides? #Closed Refers to: src/Compilers/CSharp/Portable/Binder/DecisionDagBuilder.cs:1442 in e6d7842. [](commit_id = e6d7842, deletion_comment = False) |
/// <summary> | ||
/// Determine if two <see cref="BoundDagTemp"/>s represent the same value for the purpose of a pattern evaluation. | ||
/// </summary> | ||
public bool IsSameValue(BoundDagTemp other) |
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.
Done with review pass (commit 84), it looks like there are legitimate test failures. |
ec65c8d
to
5e4d260
Compare
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 86)
I also only reviewed commits passed 79. Consider squashing commits 80 and up into a single commit before merging. |
Taking another look to understand the difference and what I'd missed. Go ahead and squash the non-merge portion of the PR, then we'll merge. Thanks |
case var (s1, s2) when s1 == s2: | ||
if (conditions != null) | ||
{ | ||
relationCondition = Tests.AndSequence.Create(conditions); |
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.
Not related to this PR: would be clearer if we renamed this overload to CreateAndFree
@@ -4984,34 +4979,33 @@ void Test(int[][] a) | |||
Diagnostic(ErrorCode.ERR_SwitchCaseSubsumed, "[[42]]").WithLocation(9, 18)); | |||
|
|||
VerifyDecisionDagDump<SwitchStatementSyntax>(comp, | |||
@"[0]: t0 != null ? [1] : [27] | |||
@"[0]: t0 != null ? [1] : [26] |
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.
Consider adding a test like Subsumption_15
or Subsumption_16
(which involve multiple preconditions to match temps) where the subsumption results from types (one is I and Base
and the other is Derived
) rather than remaining values.
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 (iteration 86) with a test suggestion
Relates to test plan #51289