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

🐞 List.Pop<L> not working with single entry arrays #279

Open
rubenaeg opened this issue Dec 7, 2021 · 1 comment
Open

🐞 List.Pop<L> not working with single entry arrays #279

rubenaeg opened this issue Dec 7, 2021 · 1 comment

Comments

@rubenaeg
Copy link

rubenaeg commented Dec 7, 2021

🐞 Bug Report

Describe the bug

When using List.Pop<L> with only one entry in the list, the resulting type is an empty list instead of the single element.

Reproduce the bug

// This throws a compiler error
const invalid: List.Pop<['key']> = ['key'];

// This works
const valid: List.Pop<['key']> = [];

Expected behavior

I would expect the type to behave similar to Array.pop(), and it's description lets one assume that it does, but the above example showcases that this is not the case.

Possible Solution

I'm currently testing out a solution for this, as soon as I have more insight I will update the issue.

Screenshots

Additional context

@wushuang5112
Copy link

wushuang5112 commented Dec 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants