Skip to content

Commit ad13a7c

Browse files
authored
Merge pull request #41 from Cysharp/hadashiA/nullable-enable
Make generated code `#nullable enable`
2 parents 70df6da + 8dde2e5 commit ad13a7c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sandbox/Generated/UnitGenerator/UnitGenerator.SourceGenerator/UnitOfAttribute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// <auto-generated>
22
// THIS (.cs) FILE IS GENERATED BY UnitGenerator. DO NOT CHANGE IT.
33
// </auto-generated>
4-
#pragma warning disable CS8669
5-
#pragma warning disable CS8625
4+
#nullable enable
65
using System;
76
#if NET7_0_OR_GREATER
87
using System.Numerics;
@@ -16,7 +15,7 @@ internal class UnitOfAttribute : Attribute
1615
public Type Type { get; }
1716
public UnitGenerateOptions Options { get; }
1817
public UnitArithmeticOperators ArithmeticOperators { get; set; } = UnitArithmeticOperators.All;
19-
public string ToStringFormat { get; set; }
18+
public string? ToStringFormat { get; set; }
2019

2120
public UnitOfAttribute(Type type, UnitGenerateOptions options = UnitGenerateOptions.None)
2221
{

src/UnitGenerator/SourceGenerator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ private void SetDefaultAttribute(GeneratorPostInitializationContext context)
123123
// <auto-generated>
124124
// THIS (.cs) FILE IS GENERATED BY UnitGenerator. DO NOT CHANGE IT.
125125
// </auto-generated>
126-
#pragma warning disable CS8669
127-
#pragma warning disable CS8625
126+
#nullable enable
128127
using System;
129128
#if NET7_0_OR_GREATER
130129
using System.Numerics;
@@ -138,7 +137,7 @@ internal class UnitOfAttribute : Attribute
138137
public Type Type { get; }
139138
public UnitGenerateOptions Options { get; }
140139
public UnitArithmeticOperators ArithmeticOperators { get; set; } = UnitArithmeticOperators.All;
141-
public string ToStringFormat { get; set; }
140+
public string? ToStringFormat { get; set; }
142141
143142
public UnitOfAttribute(Type type, UnitGenerateOptions options = UnitGenerateOptions.None)
144143
{

0 commit comments

Comments
 (0)