It was pointed out that the previous fix
(5c74e0e16f) wasn't strong mode safe
because the returned array when length = 0 was not properly typed.
This fixes the issue by removing the old fix and simply removing the
assert.
Bug: 31381
Change-Id: I6d63d3329da2711067f632adbb9be998a4d468d9
Reviewed-on: https://dart-review.googlesource.com/37741
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
also fixes#31058, DDC failed to execute all field initializers
(already fixed this in DDK when porting code_generator).
also fixes assertion_initializer_test, it was not strong mode clean, so
it was not giving any meaningful results for runtime behavior.
Change-Id: I290b266ad77ed92851cc2d0617690c6c021182a3
Reviewed-on: https://dart-review.googlesource.com/37866
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Since dart2js doesn't implement Dart 2 yet, the RuntimeError status must
be copied for each of the many dart2js configurations.
Change-Id: I7814546ce808922bf62c12d6c5443eee8600a5c7
Reviewed-on: https://dart-review.googlesource.com/37940
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Before any ASTs are constructed, a lookup happens to see if such a constructor exists, otherwise the AST replacement will not proceed, and even temporary ASTs will not be created: in this way we can add the test test_visitMethodInvocations_not_implicit_constructor.
Change-Id: I01e25af5d1eaec659cf02ca89f8a9a5da334e6a9
Reviewed-on: https://dart-review.googlesource.com/37920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
As far as I can tell, this case never gets hit because there is separate
support for ignoring cast failures on function types elsewhere.
Change-Id: I78bd8d0af10764477505545384f5103f294228bf
Reviewed-on: https://dart-review.googlesource.com/37648
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Dart allows 'external' functions which are not connected to their body.
Calling such functions produces runtime error, but they should be accepted
at compile time. Test language_2/external_test verifies this behavior.
This CL fixes treeshaker/findNativeName to return 'null' instead of throwing
an error for 'external' functions without @ExternalName annotation (which
is used to specify native name).
Change-Id: I04ec892af29ffe064ece8fddd6f67c7acdca1139
Reviewed-on: https://dart-review.googlesource.com/37122
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This reverts commit 2912e95451 as it introduced a flaky test.
Change-Id: I09c5d64eb2fe75ed67b6af5aa60b91de88f4bbda
Reviewed-on: https://dart-review.googlesource.com/37865
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This CL removes .staticType from all Types and most Statements as they
are not currently used.
Change-Id: Ia29bac49327356b26395c4851d84941daf61614d
Reviewed-on: https://dart-review.googlesource.com/37124
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* _ReceiverTypeBuilder class is introduced to create receiver type more
efficiently (without using union operations and creating intermediate
types).
* Certain tracing prints are hidden behind kPrintTrace flag to avoid
expensive string interpolations.
* Also, added debugging flag for dumping class hierarchy.
This CL reduces analysis time of Flutter gallery by ~2x.
Change-Id: Ia918b88a4d902895e77aac306dc6a5cf9cecad14
Reviewed-on: https://dart-review.googlesource.com/37644
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL refactors parseTopLevelMember so that it does not scan ahead
using findMemberName. This is the next step in removing findMemberName
to improve top level declaration recovery.
Change-Id: I4d949f72cba5618541448c08e1756bf45a4d1762
Reviewed-on: https://dart-review.googlesource.com/37680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
'void' is now allowed as type annotation for locals, fields, and formal
parameters, in addition to being previously allowed as type argument.
Update status files.
Change-Id: I6459f56824dc0a695615d8dc87c9a8a1f9be29ef
Reviewed-on: https://dart-review.googlesource.com/37651
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Dart 2 has no notion of "checked mode", so a failed assertion in a
const constructor should always be a compile error.
Change-Id: I02227c03613346918de1e3a7f7c70d209a940b90
Reviewed-on: https://dart-review.googlesource.com/37647
Reviewed-by: Leaf Petersen <leafp@google.com>
Whenever we install a getter or setter, we need to install a corresponding
one that calls `super`, because JS treats getters/setters as pairs for the
purposes of lookup. Normally we generate the paired super accessor, but for
mixins we cannot, because we don't know what the `super` will be at compile
time. So the fix is for `mixinMembers` to handle it at run time.
Change-Id: I2b14ea437720bd26f2879c7daac5b3f796d48038
Reviewed-on: https://dart-review.googlesource.com/37645
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
This change will make it easier to transition to FIDL2.
Change-Id: Ibd69f9cb60687630b81306d5931134916d4d1d84
Reviewed-on: https://dart-review.googlesource.com/37640
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@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>