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

Extract interface needs to copy along #nullable context #37177

Closed
jasonmalinowski opened this issue Jul 12, 2019 · 3 comments
Closed

Extract interface needs to copy along #nullable context #37177

jasonmalinowski opened this issue Jul 12, 2019 · 3 comments
Assignees
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Feature - Extract Interface New Language Feature - Nullable Reference Types Nullable Reference Types
Milestone

Comments

@jasonmalinowski
Copy link
Member

If you invoke extract interface into a new file, right now we aren't copying along the nullable context so you might get ?s where you don't support them.

This needs #36101 for us to implement it properly.

@ryzngard
Copy link
Contributor

We also need to include Extract Interface as part of this, since it will have similar constraints.

Duped https://dev.azure.com/devdiv/DevDiv/_workitems/edit/843166 against this

@jinujoseph jinujoseph added the Developer Community The issue was originally reported on https://developercommunity.visualstudio.com label Sep 14, 2019
@jinujoseph jinujoseph modified the milestones: Backlog, 16.4 Sep 14, 2019
@jinujoseph jinujoseph modified the milestones: 16.4, Backlog Oct 22, 2019
@jasonmalinowski
Copy link
Member Author

We discussed this in a few different ways:

How hard would it be to do this? The biggest concern was if we have to have any code here reach back to the semantic model APIs to figure out which context was active at each of those points, since we don't flow information like that today. I believe it might be possible to instead base it on the annotation data on the symbols of the members themselves: I'd expect a type in a signature of a method to have annotated/not annotated if we're in a #nullable enable and "None" otherwise; relying on that information would also allow other scenarios too like implement interface -- there we wouldn't have the semantic model in the first place for the source of the signatures.

That all said, this issue was created a few years ago as a part of the general backlog creation for this feature; we haven't really heard much complaining about it. We have one upvote on this, but it's just that: one. We're not sure this sort of mixing is terribly common in a lot of code out there, so we're just going to close this as not planned unless we hear more demand for it.

@jasonmalinowski jasonmalinowski closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2022
@jasonmalinowski
Copy link
Member Author

And oh: we did confirm that today we don't copy the directives, but we do remove ?s in that case so we arent generating broken code. That's not ideal if the user wanted to keep those around, but we're not generating broken code which is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Feature - Extract Interface New Language Feature - Nullable Reference Types Nullable Reference Types
Projects
Status: Need Update
Development

No branches or pull requests

5 participants