Skip to content

List.removeAt throws TypeError, not ArgumentError #14013

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

Closed
DartBot opened this issue Oct 11, 2013 · 4 comments
Closed

List.removeAt throws TypeError, not ArgumentError #14013

DartBot opened this issue Oct 11, 2013 · 4 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core

Comments

@DartBot
Copy link

DartBot commented Oct 11, 2013

This issue was originally filed by [email protected]


The description of List.removeAt(int index) reads:

    Throws an ArgumentError if index is not an int.

But for lists created by new List() or new List(size), TypeError is thrown if index is not an int.

Affected test:
co19/src/LibTest/core/List/removeAt_A02_t01.dart

@lrhn
Copy link
Member

lrhn commented Oct 11, 2013

We should remove that line and just say something like "It is an error if [index] is not in the range 0 .. this.length."

It's already typed as an int, so it's obviously an error if it's not assignable to int. We just need to rule out null and negative/too big integers.


Added Area-Library, Library-Core, Triaged labels.

@floitschG
Copy link
Contributor

Except that the documentation guys don't like "It is an error". So it should say "The argument [index] must be an integer in the range 0 .. this.length" (or similar.

@lrhn
Copy link
Member

lrhn commented Nov 13, 2013

Set owner to @lrhn.
Added Started label.

@lrhn
Copy link
Member

lrhn commented Dec 16, 2013

Added Fixed label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core labels Dec 16, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core
Projects
None yet
Development

No branches or pull requests

4 participants