Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shoki smart constructors support element type widening #30

Open
jnape opened this issue Aug 16, 2021 · 0 comments
Open

Shoki smart constructors support element type widening #30

jnape opened this issue Aug 16, 2021 · 0 comments
Milestone

Comments

@jnape
Copy link
Member

jnape commented Aug 16, 2021

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.

@jnape jnape added this to the alpha-3 milestone Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant