Skip to content

Smdn.Reflection.ReverseGenerating version 1.0.5

Choose a tag to compare

@smdn smdn released this 07 Mar 14:30
· 593 commits to main since this release
03202fd

Released package

Release notes

The full release notes are available at gist.

Change log

Change log in this release:

API changes

API changes in this release:
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
index 6355e5f..c02a07a 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net45.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (net45))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
 //   Name: Smdn.Reflection.ReverseGenerating
-//   AssemblyVersion: 1.0.4.0
-//   InformationalVersion: 1.0.4 (net45)
+//   AssemblyVersion: 1.0.5.0
+//   InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
 //   TargetFramework: .NETFramework,Version=v4.5
 //   Configuration: Release
 
 using System;
 using System.Collections.Generic;
 using System.Reflection;
 using Smdn.Reflection;
 using Smdn.Reflection.ReverseGenerating;
 
 namespace Smdn.Reflection.ReverseGenerating {
   public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
 
   public enum MethodBodyOption : int {
     EmptyImplementation = 1,
     None = 0,
     ThrowNotImplementedException = 2,
   }
 
   public static class CSharpFormatter {
     public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
     public static string FormatAccessibility(Accessibility accessibility) {}
     public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
     public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
     public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
     public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
     public static IEnumerable<string> ToNamespaceList(Type t) {}
   }
 
   public static class Generator {
     public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
   }
 
   public class GeneratorOptions {
     public class AttributeDeclarationOptions {
       public AttributeDeclarationOptions() {}
 
       public AttributeTypeFilter TypeFilter { get; set; }
       public bool WithNamedArguments { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class MemberDeclarationOptions {
       public MemberDeclarationOptions() {}
 
       public MethodBodyOption MethodBody { get; set; }
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class TypeDeclarationOptions {
       public TypeDeclarationOptions() {}
 
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class ValueDeclarationOptions {
       public ValueDeclarationOptions() {}
 
       public bool UseDefaultLiteral { get; set; }
     }
 
     public GeneratorOptions() {}
 
     public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
     public bool IgnorePrivateOrAssembly { get; set; }
     public string Indent { get; set; }
     public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
     public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
     public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
     public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
   }
 }
 
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
index 18975c9..6e7284d 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net47.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (net47))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
 //   Name: Smdn.Reflection.ReverseGenerating
-//   AssemblyVersion: 1.0.4.0
-//   InformationalVersion: 1.0.4 (net47)
+//   AssemblyVersion: 1.0.5.0
+//   InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
 //   TargetFramework: .NETFramework,Version=v4.7
 //   Configuration: Release
 
 using System;
 using System.Collections.Generic;
 using System.Reflection;
 using Smdn.Reflection;
 using Smdn.Reflection.ReverseGenerating;
 
 namespace Smdn.Reflection.ReverseGenerating {
   public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
 
   public enum MethodBodyOption : int {
     EmptyImplementation = 1,
     None = 0,
     ThrowNotImplementedException = 2,
   }
 
   public static class CSharpFormatter {
     public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
     public static string FormatAccessibility(Accessibility accessibility) {}
     public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
     public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
     public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
     public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
     public static IEnumerable<string> ToNamespaceList(Type t) {}
   }
 
   public static class Generator {
     public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
   }
 
   public class GeneratorOptions {
     public class AttributeDeclarationOptions {
       public AttributeDeclarationOptions() {}
 
       public AttributeTypeFilter TypeFilter { get; set; }
       public bool WithNamedArguments { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class MemberDeclarationOptions {
       public MemberDeclarationOptions() {}
 
       public MethodBodyOption MethodBody { get; set; }
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class TypeDeclarationOptions {
       public TypeDeclarationOptions() {}
 
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class ValueDeclarationOptions {
       public ValueDeclarationOptions() {}
 
       public bool UseDefaultLiteral { get; set; }
     }
 
     public GeneratorOptions() {}
 
     public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
     public bool IgnorePrivateOrAssembly { get; set; }
     public string Indent { get; set; }
     public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
     public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
     public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
     public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
   }
 }
 
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net5.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net5.0.apilist.cs
index a470142..bfaef74 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net5.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-net5.0.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (net5.0))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
 //   Name: Smdn.Reflection.ReverseGenerating
-//   AssemblyVersion: 1.0.4.0
-//   InformationalVersion: 1.0.4 (net5.0)
+//   AssemblyVersion: 1.0.5.0
+//   InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
 //   TargetFramework: .NETCoreApp,Version=v5.0
 //   Configuration: Release
 
 using System;
 using System.Collections.Generic;
 using System.Reflection;
 using Smdn.Reflection;
 using Smdn.Reflection.ReverseGenerating;
 
 namespace Smdn.Reflection.ReverseGenerating {
   public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
 
   public enum MethodBodyOption : int {
     EmptyImplementation = 1,
     None = 0,
     ThrowNotImplementedException = 2,
   }
 
   public static class CSharpFormatter {
     public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
     public static string FormatAccessibility(Accessibility accessibility) {}
     public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
     public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
     public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
     public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
     public static IEnumerable<string> ToNamespaceList(Type t) {}
   }
 
   public static class Generator {
     public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
   }
 
   public class GeneratorOptions {
     public class AttributeDeclarationOptions {
       public AttributeDeclarationOptions() {}
 
       public AttributeTypeFilter TypeFilter { get; set; }
       public bool WithNamedArguments { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class MemberDeclarationOptions {
       public MemberDeclarationOptions() {}
 
       public MethodBodyOption MethodBody { get; set; }
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class TypeDeclarationOptions {
       public TypeDeclarationOptions() {}
 
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class ValueDeclarationOptions {
       public ValueDeclarationOptions() {}
 
       public bool UseDefaultLiteral { get; set; }
     }
 
     public GeneratorOptions() {}
 
     public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
     public bool IgnorePrivateOrAssembly { get; set; }
     public string Indent { get; set; }
     public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
     public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
     public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
     public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
   }
 }
 
diff --git a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-netstandard2.0.apilist.cs b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-netstandard2.0.apilist.cs
index 1e00797..a13e562 100644
--- a/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-netstandard2.0.apilist.cs
+++ b/doc/api-list/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating-netstandard2.0.apilist.cs
@@ -1,90 +1,90 @@
-// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.4 (netstandard2.0))
+// Smdn.Reflection.ReverseGenerating.dll (Smdn.Reflection.ReverseGenerating-1.0.5)
 //   Name: Smdn.Reflection.ReverseGenerating
-//   AssemblyVersion: 1.0.4.0
-//   InformationalVersion: 1.0.4 (netstandard2.0)
+//   AssemblyVersion: 1.0.5.0
+//   InformationalVersion: 1.0.5+dd9591cbed8623f61349f46c833f14f1578db406
 //   TargetFramework: .NETStandard,Version=v2.0
 //   Configuration: Release
 
 using System;
 using System.Collections.Generic;
 using System.Reflection;
 using Smdn.Reflection;
 using Smdn.Reflection.ReverseGenerating;
 
 namespace Smdn.Reflection.ReverseGenerating {
   public delegate bool AttributeTypeFilter(Type type, ICustomAttributeProvider attributeProvider);
 
   public enum MethodBodyOption : int {
     EmptyImplementation = 1,
     None = 0,
     ThrowNotImplementedException = 2,
   }
 
   public static class CSharpFormatter {
     public static string EscapeString(string s, bool escapeSingleQuote = false, bool escapeDoubleQuote = false) {}
     public static string FormatAccessibility(Accessibility accessibility) {}
     public static string FormatParameter(ParameterInfo p, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(MethodBase m, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatParameterList(ParameterInfo[] parameterList, bool typeWithNamespace = true, bool useDefaultLiteral = false) {}
     public static string FormatSpecialNameMethod(MethodBase methodOrConstructor, out MethodSpecialName nameType) {}
     public static string FormatTypeName(this Type t, ICustomAttributeProvider attributeProvider = null, bool typeWithNamespace = true, bool withDeclaringTypeName = true, bool translateLanguagePrimitiveType = true) {}
     public static string FormatValueDeclaration(object val, Type typeOfValue, bool typeWithNamespace = true, bool findConstantField = false, bool useDefaultLiteral = false) {}
     public static bool IsLanguagePrimitiveType(Type t, out string primitiveTypeName) {}
     public static IEnumerable<string> ToNamespaceList(Type t) {}
   }
 
   public static class Generator {
     public static IEnumerable<string> GenerateAttributeList(ICustomAttributeProvider attributeProvider, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateGenericArgumentConstraintDeclaration(Type genericArgument, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateMemberDeclaration(MemberInfo member, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static string GenerateTypeDeclaration(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
     public static IEnumerable<string> GenerateTypeDeclarationWithExplicitBaseTypeAndInterfaces(Type t, ISet<string> referencingNamespaces, GeneratorOptions options) {}
   }
 
   public class GeneratorOptions {
     public class AttributeDeclarationOptions {
       public AttributeDeclarationOptions() {}
 
       public AttributeTypeFilter TypeFilter { get; set; }
       public bool WithNamedArguments { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class MemberDeclarationOptions {
       public MemberDeclarationOptions() {}
 
       public MethodBodyOption MethodBody { get; set; }
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class TypeDeclarationOptions {
       public TypeDeclarationOptions() {}
 
       public bool OmitEndOfStatement { get; set; }
       public bool WithAccessibility { get; set; }
       public bool WithDeclaringTypeName { get; set; }
       public bool WithNamespace { get; set; }
     }
 
     public class ValueDeclarationOptions {
       public ValueDeclarationOptions() {}
 
       public bool UseDefaultLiteral { get; set; }
     }
 
     public GeneratorOptions() {}
 
     public GeneratorOptions.AttributeDeclarationOptions AttributeDeclaration { get; }
     public bool IgnorePrivateOrAssembly { get; set; }
     public string Indent { get; set; }
     public GeneratorOptions.MemberDeclarationOptions MemberDeclaration { get; }
     public bool TranslateLanguagePrimitiveTypeDeclaration { get; set; }
     public GeneratorOptions.TypeDeclarationOptions TypeDeclaration { get; }
     public GeneratorOptions.ValueDeclarationOptions ValueDeclaration { get; }
   }
 }
 

Full changes

Full changes in this release:
diff --git a/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating.csproj b/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating.csproj
index ee418c3..99fa587 100644
--- a/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating.csproj
+++ b/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating.csproj
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
   <PropertyGroup>
     <TargetFrameworks>net5.0;net47;net45;netstandard2.0</TargetFrameworks>
     <RootNamespace>Smdn.Reflection.ReverseGenerating</RootNamespace>
-    <VersionPrefix>1.0.4</VersionPrefix>
+    <VersionPrefix>1.0.5</VersionPrefix>
     <VersionSuffix></VersionSuffix>
     <PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
     <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@@ -19,6 +19,10 @@ SPDX-License-Identifier: MIT
     ">$(DefineConstants);CAN_OVERRIDE_CUSTOMATTRIBUTEDATA_ATTRIBUTETYPE</DefineConstants>
   </PropertyGroup>
 
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' " Label="Required properties to generate API list">
+    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
+  </PropertyGroup>
+
   <PropertyGroup Label="metadata">
     <Description>The reflection library for reverse generating type definitions.</Description>
     <CopyrightYear>2020</CopyrightYear>
diff --git a/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.cs b/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.cs
index 719819d..3fdffbd 100644
--- a/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.cs
+++ b/src/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.cs
@@ -2,6 +2,7 @@
 // SPDX-License-Identifier: MIT
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;
 using System.Reflection;
 using System.Runtime.InteropServices;
@@ -339,9 +340,21 @@ public static partial class Generator {
           );
 
           if (valueDeclaration == null) {
+            var stringifiedValue = val switch {
+              string s => s,
+              DateTime dt => dt.ToString("o"),
+              DateTimeOffset dto => dto.ToString("o"),
+              IFormattable formattable => formattable.ToString(
+                format: null,
+                formatProvider: CultureInfo.InvariantCulture // TODO: specific culture
+              ),
+              null => "null",
+              _ => val.ToString(),
+            };
+
             sb
               .Append("; // = \"")
-              .Append(CSharpFormatter.EscapeString((val ?? "null").ToString(), escapeDoubleQuote: true))
+              .Append(CSharpFormatter.EscapeString(stringifiedValue, escapeDoubleQuote: true))
               .Append('"');
           }
           else {

New Contributors

  • @smdn made their first contribution in #1

Full Changelog: https://github.com/smdn/Smdn.Reflection.ReverseGenerating/commits/releases/Smdn.Reflection.ReverseGenerating-1.0.5