Terminal.Gui
Terminal.Gui copied to clipboard
Border: Class uses `string` for `title`, not `ustring`
In addition, strings (both string and ustring) should be initizlied to .Empty and not null.
Fixing this may be a breaking change.
But you are having some issue with this? If so, then you can do ustring.Make(title) that return a ustring.
But you are having some issue with this? If so, then you can do
ustring.Make(title)that return a ustring.
Yes. In tests Assert.Equal((ustring)null, (string)null) causes an exception because Assert.Equal is not supposed to be used for checking null.
Why not adding it in the NStack? Do you want I do that?
Why not adding it in the
NStack? Do you want I do that?
I believe:
- Classes should always explicitly initialize members (so
private type foois BAD andprivate type foo = baris good. - strings (both
stringandustring) should always be initialized to.Emptyinstead ofnull.
Changing Nstack to do this encourages bad developer behavior. So no, I don't think you should do this to NStack.
In addition, strings (both
stringandustring) should be initizlied to.Emptyand notnull.
we cant initialize with a default string.Empty, see the error:

we cant initialize with a default string.Empty, see the error:
You could do
public TopLevelContainer (Border border, string title = null)
{
Initialize(Rect.Empty,border, title ?? string.Empty);
}
@tig does this issue can be closed per #1862?