Closed AnthonyLloyd closed 5 years ago
@AnthonyLloyd It's definitely a race. The code as it was was simply not checking any invariants; hence the refactor. I didn't see this error after the refactor; but the other invariants I've been forced to lessen, because there's some serious interleaving of init, flush and dispose going on.
The 'as is' solution is to weaken the precondition check so you can release. I added my list of invariants inside the initial type declaration of T
.
Generally, I don't want the initing of this to be dependent on calling one of the 'main' methods in Expecto, but to be lazily self-initialising, once and only once.
I have taken out the flush in the duplicate names.
Can I just ask about the color change? It looks less bright now. If it's more correct then that's fine. Just a little worried about user feedback.
Well, it is indeed less bright. The colours as they were, were the brightest possible (which is different from the default console white even).
I've also tested the inverted colours on white backgrounds, so they are visible; and I noticed that the Console.{Background,Foreground}Color
return -1 on macOS/Core/zsh/iTerm2, so I handled that case as well.
I also translated it to 256 colours (it's 2018 after all), which should be automatically mapped back to 16 colours if the console in use doesn't handle 256.
Lastly, some colours were mapped to each other, i.e. it was a many-to-one mapping. I tried to avoid this, so that the different colourisation types are distinguishable.
Cool. Just setting up a release.
@haf I can look but do you have an idea. Seems some kind of race.