Bug 142 - MemberAttribute-based enums throw NullReferenceException on enumField.Name access #244
build.yaml
on: pull_request
ubuntu-latest
1m 36s
windows-latest
5m 53s
run-snapshots
11m 35s
macOS-latest
1m 31s
Annotations
10 errors
SnapshotTests.GeneralTests.custom_type_literal_new_infer_field_name
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\snapshots\snap-v8.0
NotEqual:
- Received: GeneralTests.custom_type_literal_new_infer_field_name.received.txt
Verified: GeneralTests.custom_type_literal_new_infer_field_name.verified.txt
FileContent:
NotEqual:
Received: GeneralTests.custom_type_literal_new_infer_field_name.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
using Whatever;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(FooEnumSystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(FooEnumTypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(FooEnumDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: Whatever.Foo, Value = { _value }")]
public partial class FooEnum :
global::System.IEquatable<FooEnum>,
global::System.IComparable,
global::System.IComparable<FooEnum>
{
private static readonly System.Lazy<System.Collections.Generic.Dictionary<string, FooEnum>> _namesToEnums = new( () =>
new()
{
{ "Fred", Fred },
{ "Wilma", Wilma },
});
private static readonly System.Lazy<System.Collections.Generic.Dictionary<Whatever.Foo, FooEnum>> _valuesToEnums = new( () =>
new()
{
{ Fred.Value, Fred },
{ Wilma.Value, Wilma },
});
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private Whatever.Foo _value;
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
Fred.Name = "Fred";
Wilma.Name = "Wilma";
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="Whatever.Foo" /> value if set, otherwise default
/// </summary>
public Whatever.Foo Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public FooEnum()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public FooEnum(Whatever.Foo value)
{
_value = value;
|
SnapshotTests.TryParseHoisting.Tests.Test
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\TryParseHoisting\snapshots\snap-v8.0
NotEqual:
- Received: Tests.Test.received.txt
Verified: Tests.Test.verified.txt
FileContent:
NotEqual:
Received: Tests.Test.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
using Whatever;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(PlanetEnumSystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(PlanetEnumTypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(PlanetEnumDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: Whatever.Planet, Value = { _value }")]
public partial class PlanetEnum :
global::System.IEquatable<PlanetEnum>,
global::System.IComparable,
global::System.IComparable<PlanetEnum>
{
private static readonly System.Lazy<System.Collections.Generic.Dictionary<string, PlanetEnum>> _namesToEnums = new( () =>
new()
{
{ "Jupiter", Jupiter },
{ "Mars", Mars },
{ "Venus", Venus },
});
private static readonly System.Lazy<System.Collections.Generic.Dictionary<Whatever.Planet, PlanetEnum>> _valuesToEnums = new( () =>
new()
{
{ Jupiter.Value, Jupiter },
{ Mars.Value, Mars },
{ Venus.Value, Venus },
});
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private Whatever.Planet _value;
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
Jupiter.Name = "Jupiter";
Mars.Name = "Mars";
Venus.Name = "Venus";
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="Whatever.Planet" /> value if set, otherwise default
/// </summary>
public Whatever.Planet Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public PlanetEnum()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public PlanetEnum(Whatever.Planet value)
{
_va
|
SnapshotTests.BugFixTests.BugFix142.BugFix142.With_an_inferred_name_and_value_field_for_a_string
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\BugFixTests\snapshots\snap-v8.0
NotEqual:
- Received: BugFix142.With_an_inferred_name_and_value_field_for_a_string.received.txt
Verified: BugFix142.With_an_inferred_name_and_value_field_for_a_string.verified.txt
FileContent:
NotEqual:
Received: BugFix142.With_an_inferred_name_and_value_field_for_a_string.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(OneMemberAttributeAndOneImplicitFieldSystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(OneMemberAttributeAndOneImplicitFieldTypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(OneMemberAttributeAndOneImplicitFieldDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.String, Value = { _value }")]
public partial class OneMemberAttributeAndOneImplicitField :
global::System.IEquatable<OneMemberAttributeAndOneImplicitField>,
global::System.IComparable,
global::System.IComparable<OneMemberAttributeAndOneImplicitField>
{
// const fields...
public const System.String TwoValue = "Two";
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private System.String _value;
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
Two.Name = "Two";
Two._value = "Two";
Two._isInitialized = true;
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="System.String" /> value if set, otherwise default
/// </summary>
public System.String Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public OneMemberAttributeAndOneImplicitField()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public OneMemberAttributeAndOneImplicitField(System.String value)
{
_value = value;
Name = "[INFERRED-TO-BE-REPLACED!]";
_isInitialized = true;
}
|
SnapshotTests.GeneralStuff.GeneralTests+When_using_static_fields_that_are_newed_up.The_name_and_value_of_the_member_is_inferred
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\GeneralStuff\snapshots\snap-v8.0
NotEqual:
- Received: GeneralTests.When_using_static_fields_that_are_newed_up.The_name_and_value_of_the_member_is_inferred.received.txt
Verified: GeneralTests.When_using_static_fields_that_are_newed_up.The_name_and_value_of_the_member_is_inferred.verified.txt
FileContent:
NotEqual:
Received: GeneralTests.When_using_static_fields_that_are_newed_up.The_name_and_value_of_the_member_is_inferred.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(ESystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(ETypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(EDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.String, Value = { _value }")]
public partial class E :
global::System.IEquatable<E>,
global::System.IComparable,
global::System.IComparable<E>
{
// const fields...
public const System.String TwoValue = "Two";
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private System.String _value;
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
Two.Name = "Two";
Two._value = "Two";
Two._isInitialized = true;
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="System.String" /> value if set, otherwise default
/// </summary>
public System.String Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public E()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public E(System.String value)
{
_value = value;
Name = "[INFERRED-TO-BE-REPLACED!]";
_isInitialized = true;
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
private E(string enumName, System.String value)
{
_value = value
|
SnapshotTests.BugFixTests.BugFix142.BugFix142.With_field_declarations_that_combine_newed_up_and_non_newed_up
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\BugFixTests\snapshots\snap-v8.0
NotEqual:
- Received: BugFix142.With_field_declarations_that_combine_newed_up_and_non_newed_up.received.txt
Verified: BugFix142.With_field_declarations_that_combine_newed_up_and_non_newed_up.verified.txt
FileContent:
NotEqual:
Received: BugFix142.With_field_declarations_that_combine_newed_up_and_non_newed_up.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(ESystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(ETypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(EDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.String, Value = { _value }")]
public partial class E :
global::System.IEquatable<E>,
global::System.IComparable,
global::System.IComparable<E>
{
// const fields...
public const System.String OneValue = "One";
public const System.String TwoValue = "Two!";
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private System.String _value;
static E()
{
One = new E("One", "One");
}
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
Two.Name = "Two";
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="System.String" /> value if set, otherwise default
/// </summary>
public System.String Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public E()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public E(System.String value)
{
_value = value;
Name = "[INFERRED-TO-BE-REPLACED!]";
_isInitialized = true;
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
private E(string enumName, System.String value)
{
_value = value;
Name = enumName;
_
|
SnapshotTests.BugFixTests.BugFix142.BugFix142.With_an_inferred_name_and_value_field_for_an_int
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\BugFixTests\snapshots\snap-v8.0
NotEqual:
- Received: BugFix142.With_an_inferred_name_and_value_field_for_an_int.received.txt
Verified: BugFix142.With_an_inferred_name_and_value_field_for_an_int.verified.txt
FileContent:
NotEqual:
Received: BugFix142.With_an_inferred_name_and_value_field_for_an_int.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(OneMemberAttributeAndOneImplicitFieldSystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(OneMemberAttributeAndOneImplicitFieldTypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(OneMemberAttributeAndOneImplicitFieldDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.Int32, Value = { _value }")]
public partial class OneMemberAttributeAndOneImplicitField :
global::System.IEquatable<OneMemberAttributeAndOneImplicitField>,
global::System.IComparable,
global::System.IComparable<OneMemberAttributeAndOneImplicitField>
{
// const fields...
public const System.Int32 OneValue = 0;
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private global::System.Boolean _isInitialized;
private System.Int32 _value;
private static class __Inner
{
public static int __ComeAlive() => 42;
static __Inner()
{
One.Name = "One";
One._value = 0;
One._isInitialized = true;
}
}
private static readonly int __discard = __Inner.__ComeAlive();
/// <summary>
/// Gets the underlying <see cref="System.Int32" /> value if set, otherwise default
/// </summary>
public System.Int32 Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public OneMemberAttributeAndOneImplicitField()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public OneMemberAttributeAndOneImplicitField(System.Int32 value)
{
_value = value;
Name = "[INFERRED-TO-BE-REPLACED!]";
_isInitialized = true;
}
[gl
|
SnapshotTests.Members.UsingMemberMethods.Can_be_combined_with_member_attributes
Expected collection to be empty because the following source code should compile on Net8_0:
using Intellenum;
namespace Whatever;
[Intellenum]
[Member("OffPeak", 3)]
public partial class CustomerType
{
static CustomerType()
{
Member("Standard");
Member("Gold");
Member("Diamond");
}
}
, but found {Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(49,43): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(50,39): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(51,42): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(385,76): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(389,68): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(393,74): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(143,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(146,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(149,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(167,1): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(168,1): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(169,1): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?)}.
|
SnapshotTests.BugFixTests.BugFix142.BugFix142.Ignores_non_field_syntax
Expected collection to be empty because the following source code should compile on Net8_0:
using Intellenum;
namespace Whatever;
[Intellenum]
[Members("London, Paris, Peckham")]
public partial class City
{
public static readonly City Frankfurt;
public static City RandomMember()
{
return City.FromValue(Random.Shared.Next(List().Count()));
}
}
, but found {(13,30): error CS0103: The name 'Random' does not exist in the current context, (13,56): error CS1061: 'IEnumerable<City>' does not contain a definition for 'Count' and no accessible extension method 'Count' accepting a first argument of type 'IEnumerable<City>' could be found (are you missing a using directive or an assembly reference?)}.
|
SnapshotTests.Members.UsingMemberMethods.Can_be_specified_for_ints
Expected collection to be empty because the following source code should compile on Net8_0:
using Intellenum;
namespace Whatever;
[Intellenum]
public partial class CustomerType
{
static CustomerType()
{
Member("Standard");
Member("Gold");
Member("Diamond");
}
}
, but found {Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(48,43): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(49,39): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(50,42): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(372,76): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(376,68): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(380,74): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(139,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(142,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(145,10): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(162,35): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(163,1): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?), Intellenum\Intellenum.IntellenumGenerator\Whatever_CustomerType.g.cs(164,1): error CS0234: The type or namespace name 'Counter' does not exist in the namespace 'Intellenum' (are you missing an assembly reference?)}.
|
SnapshotTests.BugFixTests.BugFix142.BugFix142.With_just_one_member_attribute
VerifyException : Directory: D:\a\Intellenum\Intellenum\tests\SnapshotTests\BugFixTests\snapshots\snap-v8.0
NotEqual:
- Received: BugFix142.With_just_one_member_attribute.received.txt
Verified: BugFix142.With_just_one_member_attribute.verified.txt
FileContent:
NotEqual:
Received: BugFix142.With_just_one_member_attribute.received.txt
[
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a source generator named Intellenum (https://github.com/SteveDunn/Intellenum)
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669
#pragma warning disable CS1573
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
using Intellenum;
using System;
namespace Whatever
{
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Intellenum", "1.0.0.0")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(AttributeBasedEnumSystemTextJsonConverter))]
[global::System.ComponentModel.TypeConverter(typeof(AttributeBasedEnumTypeConverter))]
[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(AttributeBasedEnumDebugView))]
[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.String, Value = { _value }")]
public partial class AttributeBasedEnum :
global::System.IEquatable<AttributeBasedEnum>,
global::System.IComparable,
global::System.IComparable<AttributeBasedEnum>
{
// const fields...
public const System.String OneValue = "One";
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null;
#endif
private readonly global::System.Boolean _isInitialized;
private readonly System.String _value;
/// <summary>
/// Gets the underlying <see cref="System.String" /> value if set, otherwise default
/// </summary>
public System.String Value => _value;
[global::System.Diagnostics.DebuggerStepThroughAttribute]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public AttributeBasedEnum()
{
#if DEBUG
_stackTrace = new global::System.Diagnostics.StackTrace();
#endif
_isInitialized = false;
_value = default;
Name = "[UNDEFINED]";
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
public AttributeBasedEnum(System.String value)
{
_value = value;
Name = "[INFERRED-TO-BE-REPLACED!]";
_isInitialized = true;
}
[global::System.Diagnostics.DebuggerStepThroughAttribute]
private AttributeBasedEnum(string enumName, System.String value)
{
_value = value;
Name = enumName;
_isInitialized = true;
}
public string Name { get; private set; }
public void Deconstruct(out string Name, out System.String Value)
{
Name = this.Name;
Valu
|