-
Notifications
You must be signed in to change notification settings - Fork 387
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
Add support for Nullable build setting #4058
Comments
The design for turning on the nullable feature changed since our last discussion. Based on this, there are two scenarios of interest:
@davkean I assume that those scenarios translate into three work items:
@davkean @Pilchie Do you think the API work (1) could be reasonably scheduled as part of preview 2? If yes, I would do the codefixer (3) in preview 2 as well. |
Tagging @tmeschter per email discussion about preview2 goals. Thanks |
Fixes configuration property portion dotnet#4058 This can be acccesed using: Project.ConfigurationManager.ConfigurationRow(configurationName).Item(1).Properties["NullableReferenceTypes"]
Fixes adding configuration-specific property for dotnet#4058 Note: This is a configuraiton-specific property but writes itself without a configuration condition, similar to LangVersion. We need this because it's going to live on the Build property page which pulls from configuration. You can access this using DTE.Configuration.Properties["NullableReferenceTypes"]. We do not yet have a strongly typed API for it and will do that when legacy adds support for it.
I could get a PR out for the checkbox in the Build property page - do we have an idea of where on the page we would want it? |
For adding the checkbox to the Build property page, I think putting it under "Check for arithmetic overflow/underflow" would make sense. |
I wouldn't want to add the checkbox without adding the underlying property support to csproj/msvbprj, and that's the expensive part. |
In my testing, it looks like the |
@chucker Yes, this property will be made to work in old project system too, before C# 8 ships as RTM, but likely after dev16.0 (where C# 8.0 language features are in beta). |
@davkean We had to modify the options to add a third one (
|
Given how I spent the last thirty minutes, it might be worth going through the existing blogs and docs for C# 8 and modify the samples on how to set up that feature. That property name change and the new option names took quite some time to figure out. Some examples are https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types or https://blogs.msdn.microsoft.com/dotnet/2018/12/05/take-c-8-0-for-a-spin/ |
This issue is tracked internally by https://dev.azure.com/devdiv/DevDiv/_workitems/edit/823504 |
From LDM discussion today (5/1/2019) including Phillip, we concluded that "Nullable" would be a better name than either "NullableReferenceTypes" or "NullableContextOptions". It should remain a string (to accept "enable", "disable" and a couple of other values). Relates to compiler work item dotnet/roslyn#35432 |
Moved bug report to separate issue: #5551 |
@drewnoakes @chucker @tmeschter @davkean I noticed this old issue. I assume that we still want to expose this checkbox. What release should we aim for? |
@jcouv I took a look at this but hit a block that would require help from @davkean or someone else who knows the details of the property pages better than me. In short, adding the UI was straightforward, however we only want to enable that UI when |
@drewnoakes regarding legacy projects, I take from #5551 (comment) that this is no longer planned, so the UI can focus on CPS. (I'd love to be wrong, though.) |
PR #5807 is up to fix this. |
This is a tracking work item related to the "nullable reference types" feature in C# 8.0 (for dev16).
We'll add design notes here as it crystallizes (is it a property or some other form of API?)
Tagging @davkean
The text was updated successfully, but these errors were encountered: