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.
🐞 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
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