This CL adds special case for FutureOr<T> type (which is a union
of Future<T> and T) into type flow analysis.
As type flow analysis doesn't retain information about generic type
arguments yet, FutureOr<T> is treated as AnyType for now.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Ieb4d862b5a993fe46c9662d9bcb0e1f06058a166
Reviewed-on: https://dart-review.googlesource.com/40463
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This CL fixes the case when an invocation is invalidated in the
middle of processing. In such case, its result should not be retained
and it should be re-processed again.
Also:
* _WorkList.pending Set is replaced with LinkedList (reduces analysis time).
* ClassHierarchy is configured to ignore ambiguous supertypes.
* _AssertionError._throwNew entry point is added (as it is implicitly
inserted by flow graph builder).
Change-Id: Ie2d5d29352a5463fbe602910f9ae7f6f77a917d7
Reviewed-on: https://dart-review.googlesource.com/37126
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
* Invocation handlers and InvocationAnalyzer are revised to reduce
complexity of the code, improve precision and efficiency of analysis.
* Invocation now has 2 subclasses: DirectInvocation and
DispatchableInvocation; processing of invocations is moved to these
subclasses and simplified.
DirectInvocation is responsible for processing particular
methods and fields, while DispatchableInvocation processes polymorphic
calls by collecting targets and accurate receiver types for each target,
and delegating to DirectInvocations for processing of each target.
* Dynamic tear-offs and dynamic calls via getter/field are
supported.
* Invalidation of field initializers is implemented.
* Implicit 'return null' at the end of a function is correctly
detected.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I3d2ea69fbc95e3eb9aee244ee909016dfcf79bee
Reviewed-on: https://dart-review.googlesource.com/34507
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>