-
Notifications
You must be signed in to change notification settings - Fork 170
Document and tidy UnrelatedTypesProcessors #1458
Conversation
{List<InterfaceType> acc = const []}) => | ||
acc.contains(type) | ||
? acc | ||
{List<InterfaceType> accumulator = const []}) => |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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> {} | |||
|
There was a problem hiding this comment.
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 {} |
There was a problem hiding this comment.
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.
Late to the party but chiming in to thank you for fixing this up! 🍻 |
|
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.