3 ms·
In this example, it's why Java added sealed interfaces, otherwise left with ∞ - 1 possibilities. if (!(node instanceof DomNode.Element)) { return new Ren
by ljloisnflwef 5y ago
In this example, it's why Java added sealed interfaces, otherwise left with ∞ - 1 possibilities.
if (!(node instanceof DomNode.Element)) {
return new RenderNode.Noop(/* ... */);
}
Layout layout = node.layout;
return new RenderNode.Styled(layout, /* ... */);
- kragen 5y agoIt's true that we return a `RenderNode.Noop` in ∞ - 1 cases, but that's okay because we're not making any demands of `node` there.