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

Fixes the strong-mode analysis errors. #290

Merged
merged 2 commits into from
Apr 22, 2016
Merged

Fixes the strong-mode analysis errors. #290

merged 2 commits into from
Apr 22, 2016

Conversation

emesx
Copy link
Contributor

@emesx emesx commented Apr 4, 2016

This fixes issues #285 and #286

Ran all tests, all tests pass (except the one reported in #287).
SDK used: 1.16.0-dev.3.0

@@ -438,7 +436,7 @@ class AvlTreeSet<V> extends TreeSet<V> {
}

bool remove(Object item) {
AvlNode<V> x = _getNode(item);
AvlNode<V> x = _getNode(item as V);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw if item is not a V, is this the intended behaviour?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_getNode feeds item into comparator, which is generic and demands a V. I would therefore go further and make item parameter V rather than Object.

@cbracken What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nvm, we are implementing Iterable. In that case we can probably do this:

if (item is! V) {
  return false;
}

...

@yjbanov yjbanov mentioned this pull request Apr 11, 2016
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot
Copy link

CLAs look good, thanks!

@emesx
Copy link
Contributor Author

emesx commented Apr 11, 2016

Have just rebased to current master.

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

Successfully merging this pull request may close these issues.

5 participants