LordKalma (CT7ALW)
Smart enums, inheritance and "siblings" behaving weirdly and I don't understand why.
With
and
The test still fails
Message: System.TypeInitializationException : The type initializer for 'AetherLogger.Models.Mode' threw an exception. ----> System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: ModeTests.DifferentModesHaveDifferentSubModes() line 9 RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) --NullReferenceException <>c.<GetAllOptions>b4_2(TEnum t) EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) EnumerableSorter
1.ComputeMap(TElement[] elements, Int32 count) EnumerableSorter1.Sort(TElement[] elements, Int32 count) OrderedEnumerable
1.Fill(Buffer1 buffer, Span
1 destination) OrderedEnumerable1.ToArray() SmartEnum
2.GetAllOptions() Lazy1.ViaFactory(LazyThreadSafetyMode mode) Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) Lazy`1.CreateValue() <.cctor>b36_0() Lazy1.ViaFactory(LazyThreadSafetyMode mode) Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) Lazy1.CreateValue() SmartEnum
2.get_List() Mode.cctor() line 23
19 replies
Smart enums, inheritance and "siblings" behaving weirdly and I don't understand why.
Message: System.TypeInitializationException : The type initializer for 'AetherLogger.Models.Mode' threw an exception. ----> System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: ModeTests.DifferentModesHaveDifferentSubModes() line 9 RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) --NullReferenceException <>c.<GetAllOptions>b4_2(TEnum t) EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) EnumerableSorter
1.ComputeMap(TElement[] elements, Int32 count) EnumerableSorter1.Sort(TElement[] elements, Int32 count) OrderedEnumerable
1.Fill(Buffer1 buffer, Span
1 destination) OrderedEnumerable1.ToArray() SmartEnum
2.GetAllOptions() Lazy1.ViaFactory(LazyThreadSafetyMode mode) Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) Lazy`1.CreateValue() <.cctor>b36_0() Lazy1.ViaFactory(LazyThreadSafetyMode mode) Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) Lazy1.CreateValue() SmartEnum
2.get_List() Mode.cctor() line 23
19 replies
Smart enums, inheritance and "siblings" behaving weirdly and I don't understand why.
Doing this the following test is completly broken:
With the error:
System.TypeInitializationException : The type initializer for 'AetherLogger.Models.Mode' threw an exception. ----> System.NullReferenceException : Object reference not set to an instance of an object.And I don't know which bit of the language I don't understand that causes this error. I would like to learn. Thank you.
19 replies