shoki
shoki copied to clipboard
Shoki smart constructors support element type widening
Since shoki
data structures are immutable, this should type-check:
interface Animal {}
class Dog implements Animal {}
class Cat implements Animal {}
StrictStack<Animal> animals = Shoki.strictStack(StrictStack.<Dog>strictStack());
...and perform no additional allocations.