Skip to content

#nullable restore in generated file should restore nullable context from project  #34094

@jcouv

Description

@jcouv

Currently, this directive behaves like #nullable disable in generated files, because the default context of generated files is "disabled".

But in the context of a Razor generated file, which mixes user code with generated code, #nullable restore would be much more useful and intuitive if it restored the context from the project.

Also, this would allow Razor to produce a #nullable restore/#nullable disable pair around blocks of user code and get the behavior that users would expect (ie. their project setting is effective). Razor would then also add @nullable ... directive in its own syntax and modulate the code it generates.

FYI @rynowak @NTaylorMullen @chsienki @cston @AlekseyTs @gafter

Relates to dotnet/razor#349

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions