Skip to content
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

NullableWalker violates invariants of slot and slot parents #39297

Closed
gafter opened this issue Oct 15, 2019 · 0 comments · Fixed by #39301
Closed

NullableWalker violates invariants of slot and slot parents #39297

gafter opened this issue Oct 15, 2019 · 0 comments · Fixed by #39301
Assignees
Labels
Milestone

Comments

@gafter
Copy link
Member

gafter commented Oct 15, 2019

I tried adding the following assertion

                HashSet<DiagnosticInfo> discardedUseSiteDiagnostics = null;
                Debug.Assert(
                    symbol.Kind != SymbolKind.Field || // we only check fields, but the NullableWalker also works with properties
                    containingSlot == 0 && !symbol.RequiresInstanceReceiver() ||
                    symbol.ContainingType.Equals(variableBySlot[containingSlot].Symbol.GetTypeOrReturnType().Type, TypeCompareKind.AllIgnoreOptions) ||
                    compilation.Conversions.IsBaseClass(variableBySlot[containingSlot].Symbol.GetTypeOrReturnType().Type, symbol.ContainingType, ref discardedUseSiteDiagnostics));

before the following line in LocalDataFlowPass.cs

                variableBySlot[slot] = identifier;

but there are a number of failures (of this assertion) in NullableWalker. It is possible that some of these are symptoms of #20648 but I believe at least the failure in NullableReferenceTypesTests.Conversions_TupleConversions_03 and two other tests is a deeper problem. I am skipping those tests to make progress on #39220, and I removing the assertion for now. The assertion should be readded after #20648 has been fixed and any issues causing the assertion to fail should be reevaluated.

@gafter gafter added this to the 16.4 milestone Oct 15, 2019
@gafter gafter self-assigned this Oct 15, 2019
@agocke agocke modified the milestones: 16.4, 16.5 Nov 1, 2019
@gafter gafter added the 4 - In Review A fix for the issue is submitted for review. label Jan 13, 2020
@jcouv jcouv modified the milestones: 16.5, 16.6 Feb 14, 2020
gafter pushed a commit that referenced this issue Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants