Skip to content

Commit

Permalink
Enable nullable context for extensions generated via T4
Browse files Browse the repository at this point in the history
Affects:

- ToDelimitedString
- Aggregate
- Fold
- Cartesian
  • Loading branch information
atifaziz committed Mar 8, 2023
1 parent b99a6a8 commit 06102d7
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 0 deletions.
10 changes: 10 additions & 0 deletions MoreLinq/Aggregate.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

namespace MoreLinq
{
using System;
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/Aggregate.g.tt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code
<#
var overloads =
from args in new[]
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/Cartesian.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

namespace MoreLinq
{
using System;
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/Cartesian.g.tt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

namespace MoreLinq
{
using System;
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/Fold.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

namespace MoreLinq
{
using System;
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/Fold.g.tt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

namespace MoreLinq
{
using System;
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/ToDelimitedString.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

#if !MORELINQ
//
// For projects that may include/embed this source file directly, suppress the
Expand Down
10 changes: 10 additions & 0 deletions MoreLinq/ToDelimitedString.g.tt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
// limitations under the License.
#endregion

#nullable enable // required for auto-generated sources (see below why)

// > Older code generation strategies may not be nullable aware. Setting the
// > project-level nullable context to "enable" could result in many
// > warnings that a user is unable to fix. To support this scenario any syntax
// > tree that is determined to be generated will have its nullable state
// > implicitly set to "disable", regardless of the overall project state.
//
// Source: https://github.com/dotnet/roslyn/blob/70e158ba6c2c99bd3c3fc0754af0dbf82a6d353d/docs/features/nullable-reference-types.md#generated-code

#if !MORELINQ
//
// For projects that may include/embed this source file directly, suppress the
Expand Down

0 comments on commit 06102d7

Please sign in to comment.