Answer the question
In order to leave comments, you need to log in
dotnet.exe crashes when accessing a variable, wut?
Good day! Most likely I just missed something simple, but I am tormented by doubts.
And so what's the problem. There is a property
It seems there is no catch, but if you perform any manipulations with the property during unit testing, for example:
then dotnet says: "I dump: 0xc00000fd" and also writes in the console "Process is terminating due to StackOverflowException.".
getters and seters:short BaseGene<short>.Code { get; set; }
Assert.IsNotNull(gene.Code);
public T Code { get => Code; set => Code = value; }
GeneInt16 gene = new GeneInt16();
Assert.IsNotNull(gene);
public GeneInt16(int? seed = null, short min = short.MinValue, short max = short.MaxValue)
{
_random = (seed == null) ? new Random() : new Random((int)seed);
Code = (short)_random.Next(min, max);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question