It's not necessary (because these types are already set correctly by
the summary linker) and it causes incorrect behavior (because due to
issue #34579 the AST nodes don't always contain correct types).
This reduces the severity of #34579 by ensuring that the incorrect
types stay in the AST nodes and don't leak into the element model.
I'll leave that issue open to remind us to make a more complete fix.
Change-Id: Ibf39370d501b5e19c9dc75713f2c39ca732870d6
Reviewed-on: https://dart-review.googlesource.com/76441
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This reverts commit 836a1d7a88.
Revert "Don't use ClassElementImpl for now in override checking."
This reverts commit 58e44c1400.
Revert "large_class_declaration_test is slow now."
This reverts commit 56f6c52d58.
Revert "Add regression test for issue 34392."
This reverts commit ef7d144bc7.
Revert "Mixin declarations don't have supertype, fix isMoreSpecificThan()."
This reverts commit 95b8a19a20.
Change-Id: Icda9cf9091ef35acc8fd61ac5dc135b3717eba0a
Reviewed-on: https://dart-review.googlesource.com/76301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
It turns out that with the new mixin syntax, we always check for error
MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE first, and if it is found,
we don't even bother checking for MIXIN_INFERENCE_NO_MATCHING_CLASS
(which I think is reasonable). So the expectations on this test need
to be changed.
Change-Id: I2a33ce60a928af63f4fc83b4e3a8309a2660b441
Reviewed-on: https://dart-review.googlesource.com/75990
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In a named mixin application, the superclass doesn't include the last
type appearing in the "with" clause, so that class isn't considered a
superclass constraint.
Fixes some test cases broken by 46e5954b0a.
Change-Id: I2e824d38017fe2c7eaa23e8f185cea07fe2222b7
Reviewed-on: https://dart-review.googlesource.com/75940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Now that we have an explicit syntax for mixins that is available all
the time, we have to do mixin inference error checking all the time,
not just when the "--supermixin" flag is supplied.
This required fixing several minor bugs:
- ErrorVerifier._checkForMixinSuperInvokedMembers did not properly
handle a mixinElement argument that was a ClassElementHandle.
- ErrorVerifier._checkMixinInference wasn't using the actual
substituted mixin types, causing errors to be wrongly reported when
a class declaration had multiple inferred mixins (this was the root
cause of #34404).
- Type names in "with" clauses in the resolved AST weren't properly
reflecting the mixin type arguments that had been inferred.
Fixes#34404.
Change-Id: Ia773233c66f8d9ab778f207689c73922e9e3a880
Reviewed-on: https://dart-review.googlesource.com/75792
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
So, instead of iterating over all subtypes and checking their supertypes
in string lists, we encode the supertype string id into int once, and
search for it in the denormalized supertype list.
This helps for files with really many classes and subtypes, such as
element.dart and as.dart (both interfaces, not implementations).
Before:
1537403233979 <= Computed implemented in 803 ms.
1537403239426 <= Computed implemented in 2518 ms.
1537403241893 <= Computed implemented in 811 ms.
1537403247675 <= Computed implemented in 2523 ms.
1537403249835 <= Computed implemented in 802 ms.
1537403255796 <= Computed implemented in 2478 ms.
1537403258396 <= Computed implemented in 809 ms.
1537403264560 <= Computed implemented in 2526 ms.
1537403267010 <= Computed implemented in 814 ms.
1537403274513 <= Computed implemented in 2491 ms.
R=brianwilkerson@google.com, paulberry@google.com
After:
1537415241048 <= Computed implemented in 421 ms.
1537415244042 <= Computed implemented in 873 ms.
1537415246189 <= Computed implemented in 402 ms.
1537415249342 <= Computed implemented in 853 ms.
1537415251478 <= Computed implemented in 420 ms.
1537415254756 <= Computed implemented in 877 ms.
1537415257278 <= Computed implemented in 492 ms.
1537415260514 <= Computed implemented in 864 ms.
1537415262864 <= Computed implemented in 421 ms.
1537415266170 <= Computed implemented in 888 ms.
Change-Id: I00e3b8d11ecc7da93816bc5575b7b79b91535d50
Reviewed-on: https://dart-review.googlesource.com/75631
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This improves performance of computing 'implemented' notifcations in
large workspaces (about 3000 files in the performance data below) and
multiple classes in the target file.
Here is data for switching between a file with a few classes, and file
with many classes. With this change it works about 10 times faster.
Before:
1537333173060 <= Computed implemented in 36 ms.
1537333173918 <= Computed implemented in 195 ms.
1537333174261 <= Computed implemented in 28 ms.
1537333175088 <= Computed implemented in 161 ms.
1537333175556 <= Computed implemented in 44 ms.
1537333176341 <= Computed implemented in 163 ms.
1537333176706 <= Computed implemented in 23 ms.
1537333177517 <= Computed implemented in 186 ms.
1537333177935 <= Computed implemented in 45 ms.
1537333178690 <= Computed implemented in 145 ms.
1537333179091 <= Computed implemented in 22 ms.
1537333179863 <= Computed implemented in 152 ms.
1537333180212 <= Computed implemented in 26 ms.
1537333181001 <= Computed implemented in 201 ms.
1537333181295 <= Computed implemented in 28 ms.
1537333182126 <= Computed implemented in 220 ms.
1537333182429 <= Computed implemented in 45 ms.
1537333183097 <= Computed implemented in 154 ms.
1537333183425 <= Computed implemented in 25 ms.
1537333184227 <= Computed implemented in 255 ms.
R=paulberry@google.com
After:
1537335150782 <= Computed implemented in 0 ms.
1537335151634 <= Computed implemented in 15 ms.
1537335152369 <= Computed implemented in 0 ms.
1537335153192 <= Computed implemented in 14 ms.
1537335153917 <= Computed implemented in 0 ms.
1537335154807 <= Computed implemented in 14 ms.
1537335155464 <= Computed implemented in 0 ms.
1537335156370 <= Computed implemented in 14 ms.
1537335157052 <= Computed implemented in 0 ms.
1537335157926 <= Computed implemented in 21 ms.
1537335158621 <= Computed implemented in 2 ms.
1537335159466 <= Computed implemented in 29 ms.
1537335160081 <= Computed implemented in 0 ms.
1537335160942 <= Computed implemented in 24 ms.
1537335161568 <= Computed implemented in 0 ms.
1537335162384 <= Computed implemented in 33 ms.
1537335162979 <= Computed implemented in 0 ms.
1537335163777 <= Computed implemented in 36 ms.
1537335164391 <= Computed implemented in 0 ms.
1537335165265 <= Computed implemented in 14 ms.
Change-Id: Ie80fa957104d394320d73306e6f506b30069a18b
Reviewed-on: https://dart-review.googlesource.com/75500
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Before this change we used the whole AnalysisOptions.signature as salt.
This means that if two packages have different set of lints, they have
different options signatures, and so we have to parse and compute
unlinked data for SDK and all shared packages separately. But unlinked
data depends only on very small set of options, practically only on
parser options.
This improves performance on workspaces with many modules and empty
cache:
Before:
<= --- Analyzing in 36122 ms.
<= Computed implemented in: 50138 ms.
<= --- Analyzing in 47905 ms.
<= Computed implemented in: 55339 ms.
<= --- Analyzing in 45141 ms.
<= Computed implemented in: 60169 ms.
After:
<= --- Analyzing in 27957 ms.
<= Computed implemented in: 11645 ms.
<= --- Analyzing in 21378 ms.
<= Computed implemented in: 9439 ms.
<= --- Analyzing in 21719 ms.
<= Computed implemented in: 10546 ms.
Here "computed implemented" is computing subtypes of classes in the
open file - it required unlinked data for all files in all available
packages.
It also helps for full cache:
analysis: 6300 vs. 5700 ms.
implemented: 5700 vs. 3700 ms.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I10dbc6d062617466ad5f35ae77bd1e58a6bb606c
Reviewed-on: https://dart-review.googlesource.com/75128
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL refactors the summary resynthesis tests similar to how
05ab41c99b refactored the summary
generation tests. It introduces the following classes:
- The interface `ResynthesizeTestStrategy`, defining the methods that
can be invoked by tests of summary resynthesis.
- An implementation of that interface:
`ResynthesizeTestStrategyTwoPhase`. This drives the summary
mechanism using the old two-phase summary API.
- Mixin classes `ExprBuilderTestCases` and `ResynthesizeTestCases`
containing the test cases themselves.
- Mixin classes `ExprBuilderTestHelpers` and `ResynthesizeTestHelpers`
containing helper methods used by the test cases.
There should be no functional change introduced by this CL, only code
motion.
Change-Id: Ifb84d4d2d8fa17bbc32b833b1f56af7e1217b5ae
Reviewed-on: https://dart-review.googlesource.com/75124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These tests were relying on some details of the summary representation
that are no longer present, namely the fact that function elements
appearing within initializers (including the synthetic function
element for an initializer) used to have inferred types associated
with them. The tests have been changed so that they exercise the same
functionality, but they use the inferred type of the variable directly
rather than going through the function elements.
Change-Id: I8e7733674bfa6f8e7f442ea04e7da702f3b11020
Reviewed-on: https://dart-review.googlesource.com/74922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This test was previously assuming that variables requiring top level
type inference would have their body expressions encoded in the
unlinked summary; with one-phase summary generation this is no longer
the case.
Change-Id: I47b4f81926eb4bc667a201ba83673e3e0db4c8cb
Reviewed-on: https://dart-review.googlesource.com/74924
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
At some point this test regressed so that it no longer tested the
behavior it purported to test. The underlying behavior is correct;
the test just had to be fixed.
Change-Id: Ia54cb205b8f1a6062f4078009d24d865d70a6bac
Reviewed-on: https://dart-review.googlesource.com/74921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
When this flag is enabled, we fail:
2 language_2/ tests;
25 Analyzer tests (mostly by 2 reasons);
0 Analysis Server tests.
There is a know problem: because unlinked summaries don't include
initializers for variables, we fail to recognize API changes related
to inferred types. I will fix this be computing API signatures from
pertinent tokens.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I61734e96ee26b3e04027a103ccf6850695815127
Reviewed-on: https://dart-review.googlesource.com/74700
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>