Skip to content

Conversation

@jcouv
Copy link
Member

@jcouv jcouv commented Jan 6, 2020

Fixes #40477 based on recent LDM decision.
Fixes #31874

Blocked on #40422 (which fixes a bug with analysis of local functions which prevents bootstrapping)

Filed issue #40821 to track the remaining issue with analysis of local functions which affected bootstrapping for this PR.

@jcouv jcouv added this to the 16.5.P2 milestone Jan 6, 2020
@jcouv jcouv self-assigned this Jan 6, 2020
@jcouv jcouv force-pushed the nullable-var branch 4 times, most recently from f58c3b0 to 7e0227e Compare January 7, 2020 04:08
@jcouv jcouv added the Blocked label Jan 7, 2020
@jcouv jcouv added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Jan 8, 2020
@jcouv jcouv removed Blocked PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Jan 8, 2020
@jcouv jcouv marked this pull request as ready for review January 8, 2020 23:55
@jcouv jcouv requested review from a team as code owners January 8, 2020 23:55
Copy link
Contributor

@sharwell sharwell Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😟 Did this just go from O(1) to O(n)? #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'll revert


In reply to: 364502110 [](ancestors = 364502110)

Copy link
Contributor

@sharwell sharwell Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❔ Was this just a test or was it needed for some reason? #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explained in OP: Filed issue #40821 to track the remaining issue with analysis of local functions which affected bootstrapping for this PR.

The code above behaves like Solution? solution = ...; which hits a problem with analysis of local functions. Most such problems were fixed by Andy yesterday, but one or two remained, which I worked around to unblock this PR (because it's not a new problem).


In reply to: 364502291 [](ancestors = 364502291)

@jcouv jcouv modified the milestones: 16.5.P2, 16.5.P3 Jan 9, 2020
@jcouv jcouv requested a review from sharwell January 9, 2020 05:44
@gafter
Copy link
Member

gafter commented Jan 9, 2020

Could you please prepare a corresponding PR to adjust a specification in csharplang? #Resolved

Copy link
Member

@gafter gafter Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToAnnotatedTypeWithAnnotations [](start = 76, length = 30)

We should consider not changing this one. The foreach variable is readonly, so nobody's going to be assigning null to it. #Resolved

Copy link
Member Author

@jcouv jcouv Jan 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in more details in another thread in this PR. Tagged you there. #Resolved

Copy link
Member

@gafter gafter Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be done for variables declared with a var pattern. The others should stay non-null. #Resolved

@gafter
Copy link
Member

gafter commented Jan 9, 2020

Finished reviewing (Iteration 4). I did not review tests deeply because I fear fixing the treatment of pattern variables may change the tests a lot. #Resolved

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still trying to sort out the IDE changes. (Making progress though!)

@jcouv jcouv requested a review from jasonmalinowski January 16, 2020 00:25
@jcouv
Copy link
Member Author

jcouv commented Jan 16, 2020

@jasonmalinowski the PR no longer has logic change in the IDE (only tests and two explicit types for bootstrap issue) #Resolved

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comprehensive IDE testing on UseExplicitType. There was one test that looked like it was asserting the wrong thing, and one also that was asserting the wrong thing which you did know about but there's a difference of how the compiler and IDE teams handle tests like that. Comments in that file.

We also should have some tests probably too on UseImplicitType to make sure we're not converting things to var if they're non-nullable, but I'm happy to file a tracking item to do that separately since I suspect any bugs you find there are existing bugs and not new bugs with this change.

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you're now testing #37309, so you may want to close that too. #WontFix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably other code/tests tagged with this issue. I'll leave that separate for now.


In reply to: 367219324 [](ancestors = 367219324)

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test typeInfo.Type.NullableAnnotation and typeInfo.ConvertedType.NullableAnnotation, or is that automatic at this point? #Resolved

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the throw null! matter here for some reason? #Resolved

Copy link
Member Author

@jcouv jcouv Jan 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the throw null! matters, but code that doesn't compile makes me uncomfortable ;-) #Resolved

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be (Program? y1)? Or otherwise this is assigning a nullable x to a non-nullable y1? #Resolved

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm not going to block this PR on this concern since this is an edge case, but I am curious!) #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is capturing existing behavior. I'll update to capture desired behavior instead, as you indicated.


In reply to: 367220385 [](ancestors = 367220385)

Copy link
Member

@jasonmalinowski jasonmalinowski Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IDE has a different pattern than the compiler here: make the test assert what should happen and then skip the test by putting the bug number in the skip attribute. We avoid having tests assert the wrong thing because it often means somebody who accidentally fixes the bug might think they made things worse, and not realize they actually made things better. The counter-argument of "but you want to know about further changes" we don't usually worry about. #Resolved

@jcouv jcouv changed the base branch from master to release/dev16.6-preview1 January 16, 2020 20:41
@jcouv
Copy link
Member Author

jcouv commented Jan 16, 2020

Moved this PR to 16.6p1 branch because of concerns with possible implications to other test scenarios. #Resolved

@jcouv jcouv modified the milestones: 16.5.P3, 16.6 Jan 21, 2020
@jcouv jcouv requested a review from a team as a code owner January 22, 2020 01:24
@jcouv
Copy link
Member Author

jcouv commented Jan 22, 2020

Rebased on top of dev16.6-preview1 and will merge when green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants