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

ExtractMethod isn't aware of nullability #30314

Closed
jcouv opened this issue Oct 4, 2018 · 3 comments
Closed

ExtractMethod isn't aware of nullability #30314

jcouv opened this issue Oct 4, 2018 · 3 comments

Comments

@jcouv
Copy link
Member

jcouv commented Oct 4, 2018

image

FYI @dpoeschl

Note this can only be fixed once the compiler exposes public APIs for nullability of expressions (see workitems list)

@jcouv jcouv changed the title ExtractMethod is not aware of nullability ExtractMethod isn't aware of nullability Oct 4, 2018
@CyrusNajmabadi
Copy link
Member

Note this can only be fixed once the compiler exposes public APIs for nullability of expressions (see workitems list)

This somewhat worries me. Is each feature going to have to know about these types? That seems... not good. Shouldn't this just fall out, just like any other type change (like adding tuples)?

@jinujoseph jinujoseph added this to the 16.0.P2 milestone Oct 5, 2018
@jinujoseph jinujoseph modified the milestones: 16.0.P2, 16.0.P3 Dec 6, 2018
@jinujoseph jinujoseph modified the milestones: 16.0.P3, 16.0.P2 Jan 5, 2019
@jinujoseph jinujoseph modified the milestones: 16.0.P2, 16.0.P3, 16.1.P1 Jan 18, 2019
@jinujoseph jinujoseph modified the milestones: 16.1.P1, Backlog Apr 24, 2019
@jasonmalinowski
Copy link
Member

jasonmalinowski commented Jun 20, 2019

Note that this one is somewhat special: if there's a variable that's being assigned throughout a method and we're lifting it to the other method, we need to declare it nullable if any assignment to it could be nullable. I'm not quite sure what the right way to do this is -- we could just walk the assignments and check if it's nullable being assigned. We may also need a special compiler API although maybe not.

@jasonmalinowski jasonmalinowski modified the milestones: Backlog, 16.3 Jul 12, 2019
@jasonmalinowski
Copy link
Member

Fixed by #37851.

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

No branches or pull requests

6 participants