Commit Graph

4364 Commits

Author SHA1 Message Date
Brian Wilkerson 2c82a400e8 Signal a static error when invoking a non-function (issue 34320)
Change-Id: Ida2998b44f52185fcd1d3be545004edff917f5ad
Reviewed-on: https://dart-review.googlesource.com/76560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 20:52:35 +00:00
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00
Paul Berry c23a9815ec Stop setting element model supertypes in TypeResolverVisitor when using new driver.
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>
2018-09-25 17:46:50 +00:00
Konstantin Shcheglov 17b3310400 Resolve bounds for type parameters of generic type alias.
R=brianwilkerson@google.com

Change-Id: Iff270adcd55d0a8c3a0bfaeed2c0741ccb1a1c77
Reviewed-on: https://dart-review.googlesource.com/76440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 17:21:04 +00:00
Brian Wilkerson a6b1a99f4c Make mixins abstract by default
Change-Id: I8ca672ac9d6acbb29ccea1bd41a617e0a870c74a
Reviewed-on: https://dart-review.googlesource.com/76303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 15:45:07 +00:00
Konstantin Shcheglov d34337aa2d Ignore noSuchMethod() for the purpose of searching concrete member implementations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: Ie597cb4d39ba16e4503503b59d1e5179c594bad5
Reviewed-on: https://dart-review.googlesource.com/76200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 02:37:03 +00:00
Konstantin Shcheglov e4eb2437b8 Look into superclassConstraints while searching for a member in interfaces.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34564
Change-Id: I11642d89710a89fb347106ff374ff0ea4227310c
Reviewed-on: https://dart-review.googlesource.com/76284
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-24 22:12:14 +00:00
Zach Anderson 95d37b0921 Revert "Implement inheritance/override checks from the spec."
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>
2018-09-24 21:27:34 +00:00
Konstantin Shcheglov 95b8a19a20 Mixin declarations don't have supertype, fix isMoreSpecificThan().
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34563
Change-Id: I0edcc887694e895856cb262865b8ec61976bafad
Reviewed-on: https://dart-review.googlesource.com/76281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 20:34:28 +00:00
Brian Wilkerson 95831136b4 Fix NPE when accessing superclass
Change-Id: I64da591bfa33a5202b7bd15de451be84330cc8bb
Reviewed-on: https://dart-review.googlesource.com/75403
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-24 17:11:23 +00:00
Konstantin Shcheglov 836a1d7a88 Implement inheritance/override checks from the spec.
This CL starts moving checks from strong-mode specific checker,
and old InheritanceManager into an implementation that is based
on the current spec, and avoids old baggage. It also fixes the issue
we were asked to fix for Dart 2.1.

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: Id5a23c5db7704b2b530bb894ae92628a08eaa70f
Reviewed-on: https://dart-review.googlesource.com/76061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 16:28:50 +00:00
Paul Berry 6a04b3079f Fix test_mixinInference_noMatchingClass_namedMixinApplication_new_syntax
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>
2018-09-21 20:52:49 +00:00
Paul Berry e22dd19b13 Create a base class for compile-time error code test cases.
This avoids the need to override tests in
CompileTimeErrorCodeTest_Driver to indicate that they pass.

Change-Id: Ieedb75c5d23edb3214b8d2cdb00a138201e3e3a7
Reviewed-on: https://dart-review.googlesource.com/75985
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-21 19:48:21 +00:00
danrubel 7cd25705ab Fix parsing label between 2 switch cases
Fix https://github.com/dart-lang/sdk/issues/34453

Change-Id: Ib2280c4482b6530dab3947a0dfd87490bd379034
Reviewed-on: https://dart-review.googlesource.com/75960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-21 19:36:40 +00:00
Paul Berry 5cf0d9e844 Replicate existing analyzer supermixin tests using new "mixin" syntax.
A few test cases fail.  I'll investigate them and follow up with fixes.

Change-Id: I934e82a2ecec68f72ed46fb698b065186ef38aad
Reviewed-on: https://dart-review.googlesource.com/75980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-21 18:34:42 +00:00
Paul Berry ead158ab5d Fix gatherMixinSupertypeConstraints to handle named mixin applications.
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>
2018-09-21 16:37:55 +00:00
Paul Berry 46e5954b0a Turn on and fix mixin type inference checks when not in "supermixin" mode.
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>
2018-09-21 01:06:25 +00:00
Mike Fairhurst 0ec9945885 Fix #33629 boolean negation of void
Bug: 33629
Change-Id: Ieabd07cd7155b60466bf6873ba8252c9b5cb8d70
Reviewed-on: https://dart-review.googlesource.com/75784
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-09-20 23:58:48 +00:00
Konstantin Shcheglov ee0a6033bf Fix checks for absence of concrete implementations of super-invoked members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34113
Change-Id: Iad8ce7f2b7787a5c9640df617d99129032f8eee4
Reviewed-on: https://dart-review.googlesource.com/75783
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-20 19:46:10 +00:00
Konstantin Shcheglov 3a5b748521 Optimize index data structure for search by supertype id.
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>
2018-09-20 19:15:07 +00:00
Dan Rubel 07a1f233f8 Improve parser recover to fix more code completion tests
Change-Id: I7bb03e18043b4951da7b63ffc146b6e7486f7e42
Reviewed-on: https://dart-review.googlesource.com/75601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-20 17:00:41 +00:00
danrubel fa0b38b45d Fix some constructor initializer code completion situations
Change-Id: Ibbe079d79889846e34ab98ccdc11ef6fcc788654
Reviewed-on: https://dart-review.googlesource.com/75600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-20 16:30:38 +00:00
Paul Berry d32e93db46 Remove unused import.
This import was mistakenly added in 2e3f17fa2b.

Change-Id: Ie89d47d4168c84eacea9d11b4c7f5bf986f5c2d7
Reviewed-on: https://dart-review.googlesource.com/75661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-20 15:44:25 +00:00
Paul Berry 4baa3ec951 Create a base class for non-error resolver test cases.
This avoids the need to override tests in NonErrorResolverTest_Driver
to indicate that they pass.

Change-Id: I2a980889bc3e32db2c6ac3873bf439a12b23c63e
Reviewed-on: https://dart-review.googlesource.com/75660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-20 15:44:16 +00:00
Paul Berry 2e3f17fa2b Add support for the new mixin syntax to supertype constraint checking and resynthesis.
Partially addresses #34404.

Change-Id: Ia115647c7e6e15092a7dca55287ff0680b780a97
Reviewed-on: https://dart-review.googlesource.com/75625
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-20 02:34:36 +00:00
Konstantin Shcheglov 41273507b2 Detect references to instance variables without declared type.
R=paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33976
Change-Id: Iea377061a784d73d41a4f77f10f74077f8797813
Reviewed-on: https://dart-review.googlesource.com/75623
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 22:40:03 +00:00
Konstantin Shcheglov 80c1b88626 Add copyright comments in resolution tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iaac51f9d4cd0ef248e8a5bf88ff6388ac7ab83c5
Reviewed-on: https://dart-review.googlesource.com/75560
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 16:58:07 +00:00
Konstantin Shcheglov bbe49524be Cache mapping from subtypes names to files where they are subtyped.
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>
2018-09-19 16:55:27 +00:00
Konstantin Shcheglov 81ce969060 Enable implicit constructors with optional parameters in mixin applications.
The spec changed in https://github.com/dart-lang/sdk/commit/63c6851dd01514e9d9e6cb96da0430e15b66d576

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34375
Change-Id: If7ba66d82fa4127cc6764d93f299790e8a862b42
Reviewed-on: https://dart-review.googlesource.com/75422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 16:12:21 +00:00
Konstantin Shcheglov bbe83465ea Test that type of the ListLiteral with two different enums is inferred.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I7b0980008fe58a1b430f989af72fb04c0fb07c8c
Reviewed-on: https://dart-review.googlesource.com/75385
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-19 00:37:59 +00:00
Alexandre Ardhuin abb392fc0d add Pubspec.dependencyOverrides
Closes #34513
https://github.com/dart-lang/sdk/pull/34513

GitOrigin-RevId: 067b26fde3631f877a6a84453ab60702bd242142
Change-Id: I4eb6ec3567d6dabfbf0a5e69fe4c6094e3a22d04
Reviewed-on: https://dart-review.googlesource.com/75360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-18 20:17:06 +00:00
Konstantin Shcheglov dcabf2cb0e Test for mixin declaration isObject and tweaks for error verifier.
R=brianwilkerson@google.com

Change-Id: I902dfdaf5e39c457e2ff365dfdd6b8f4d830497f
Reviewed-on: https://dart-review.googlesource.com/75381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-18 19:55:56 +00:00
Konstantin Shcheglov a27bafc306 Check that the concrete member in the class has same type as the super-invoked member in the mixin.
R=brianwilkerson@google.com

Change-Id: I985872d2eb5eaf7608b030b9803d664ad0878b04
Reviewed-on: https://dart-review.googlesource.com/75243
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-18 17:06:22 +00:00
Paul Berry f8eeddbc5b Fix missing import in unlinked_api_signature_test
Change-Id: I4144df4b98af2c213641715be4fbb03ee20df6c8
Reviewed-on: https://dart-review.googlesource.com/75204
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-17 19:49:17 +00:00
Konstantin Shcheglov bd103ebc50 Store unlinked data with unlinked salt.
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>
2018-09-16 17:42:23 +00:00
Konstantin Shcheglov c5d77d1d8b Support mixins in more places in index and search.
R=brianwilkerson@google.com

Change-Id: I523726e1c7f5efa2d6e2f4b91204da3f14f181b6
Reviewed-on: https://dart-review.googlesource.com/75120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-16 17:40:16 +00:00
Paul Berry c3bdb6c9b7 Refactor summary resynthesis tests in preparation for using the one-phase summary API.
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>
2018-09-16 14:11:24 +00:00
Konstantin Shcheglov ddcb8b7bb3 Remove unused SubtypeManager.
R=brianwilkerson@google.com

Change-Id: I4ec2bec51912817621361bf170257c6dfe972189
Reviewed-on: https://dart-review.googlesource.com/75123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-16 02:27:14 +00:00
Konstantin Shcheglov eb9687189d Compute unlinked API signatures without unlinked summaries.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I21c87f60d88716eb9c6b1d5e558bb17156daa598
Reviewed-on: https://dart-review.googlesource.com/74925
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-14 20:13:55 +00:00
Konstantin Shcheglov cea39db6e2 Perform instance member inference for mixins.
The set of sets is not comprehensive, no tests for fields and accessors.

R=brianwilkerson@google.com

Change-Id: I105ed6b1d4b5836f61af9f8abe7fed7e7a6b8c59
Reviewed-on: https://dart-review.googlesource.com/74941
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-14 04:52:48 +00:00
Paul Berry 65b390ca83 Simplify summary resynthesis tests
By removing unnecessary flags isStrongMode and isSharedFrontEnd.

Change-Id: I18ebb15297cc7dde38d61369d9a18b9e3bce895a
Reviewed-on: https://dart-review.googlesource.com/74966
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-14 03:06:05 +00:00
Paul Berry 0e878dd6db Fix several inferred type summary tests.
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>
2018-09-13 22:17:13 +00:00
Paul Berry 1397fd9342 Fix test_variable_final_top_level_untyped.
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>
2018-09-13 21:44:08 +00:00
Paul Berry 1a8b1bfd24 Fix test_bottom_reference_shared.
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>
2018-09-13 20:38:56 +00:00
Paul Berry 7bc5c551cd Fix test test_implicit_dependencies_follow_other_dependencies.
The test was assuming that summaries stored relative paths, which they
haven't done for quite some time.

Change-Id: Iee08f1e95650107886df85750e29aaf4267c60bb
Reviewed-on: https://dart-review.googlesource.com/74920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-13 20:36:16 +00:00
Dan Rubel 49da026e3e Report error for extends void type parameters
Change-Id: I634b836ea40199a1e7962b7d07ca9f5d1ef3f16a
Reviewed-on: https://dart-review.googlesource.com/74680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-13 20:27:56 +00:00
Konstantin Shcheglov 260ea4b591 Add an option to use one-phase summaries.
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>
2018-09-13 19:26:16 +00:00
Konstantin Shcheglov 8e4933c172 Tests for ClassElement.allSupertypes for mixins.
R=brianwilkerson@google.com

Change-Id: If8818fba6e3de02c94d098957eaacecb58938abd
Reviewed-on: https://dart-review.googlesource.com/74821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-13 18:16:10 +00:00
Brian Wilkerson c28db2d6e1 Make reporting of some errors conditional
Change-Id: I4bea35cce9f5d3da425425284c056b7ca228993e
Reviewed-on: https://dart-review.googlesource.com/74668
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-09-13 15:25:03 +00:00
Mike Fairhurst 4ee66c9708 Const evaluation for int2double
Change-Id: I4673ab47d9dfcb8de62a5190a6dd2b9c79ef1d19
Reviewed-on: https://dart-review.googlesource.com/74496
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-13 00:02:54 +00:00