Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Document and tidy UnrelatedTypesProcessors #1458

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

srawlins
Copy link
Member

I'm looking into dart-lang/sdk#57844 and dart-lang/sdk#57434, but it took me forever to understand how UnrelatedTypesProcessors works.

I thought I'd commit my doc comments and a bit of tidying first before mailing a large refactoring.

@srawlins srawlins requested a review from pq February 28, 2019 16:58
{List<InterfaceType> acc = const []}) =>
acc.contains(type)
? acc
{List<InterfaceType> accumulator = const []}) =>
Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed this to be consistent with _findIterableTypeArgument.

// arduous task of determining whether the method target implements
// [definition].

DartType targetType;
Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed this to be more meaningful.

@@ -133,22 +134,32 @@ bool takesIterable2(Iterable<String> iterable) => iterable.contains('a'); // OK
bool takesIterable3(Iterable iterable) => iterable.contains('a'); // OK

abstract class A implements Iterable<int> {}

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just the result of running dartfmt; I know these tests aren't often formatted though, so I can revert if that's preferred.

abstract class SomeIterable<E> implements Iterable<E> {}
abstract class AddlInterface {}

abstract class SomeIterable<E> implements Iterable<E>, AddlInterface {}
Copy link
Member Author

Choose a reason for hiding this comment

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

While investigating _findImplementedInterfaces, trying to figure out how it works, I couldn't find any test cases where the accumulator ever contains more than a single type. There were no commas in this test before this change, so I thought it was a good little addition to land.

@srawlins srawlins merged commit 0c9c8ed into dart-lang:master Feb 28, 2019
@srawlins srawlins deleted the tidy-unrelated branch February 28, 2019 18:00
@pq
Copy link
Member

pq commented Feb 28, 2019

Late to the party but chiming in to thank you for fixing this up!

🍻

@kevmoo
Copy link
Member

kevmoo commented Feb 28, 2019

@srawlins: I'm looking into dart-lang/sdk#57844

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

Successfully merging this pull request may close these issues.

5 participants