Commit Graph

2004 Commits

Author SHA1 Message Date
Johnni Winther a996783de5 [cfe+analyzer] Move StackListener to _fe_analyzer_shared
Change-Id: I7e0ebef15b904afc14ed3b1c0f72cde5389d9c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123730
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-02 11:21:49 +00:00
Jens Johansen 5965789b92 [CFE] Fix bug in lint test
Change-Id: Ia96bb796da4c7f966fe808499388c2058c20b841
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123726
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-01 14:13:42 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Johnni Winther 3e5b3b15a0 [cfe] Add the initial functionality of reachability analysis
Change-Id: Ifbd73805b1f7ecba12c68c760b6adccde2313cbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 12:08:30 +00:00
Paul Berry 6ea11a8b64 Decouple colors.dart from CompilerContext
We're going to move this file into _fe_analyzer_shared, so we can't
have it importing CompilerContext.  It turns out that we were only
using it to cache the decision of whether to display colors, and to
decide whether to verbosely explain how we made that decision.  Those
can be accomplished in other ways.

Change-Id: If1e3a9fee7c0ca919444d8429936045b8408c246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 11:24:20 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Jacob MacDonald 4551080062 Add retry logic for incremental compiler initialization.
Problem:

We have been having a lot of reports of failures when initializing the incremental compiler
(see https://github.com/dart-lang/sdk/issues/38102).

These appear to be the result of empty kernel files but we have added other logic to check
for that when kernel files are written, which has had zero reports of throwing from users
(https://github.com/dart-lang/build/pull/2387).

We also use the same mechanism for temp directory management as we did with analyzer, but only
see this problem with the switch to kernel, and specifically the incremental compiler.

Solution:

Add retry logic and see if that fixes the problem. Any time there is a retry log a warning
so that we don't just silently do retries all the time.

This is a general defensive mechanism to cover a broad spectrum of potential failures with the
incremental compiler in the wild. I don't intend to remove it as it isn't harmful, and the
warning logs should be enough to encourage issues to be filed if it is happening often.

I have no direct reason to believe this will actually solve the particular linked problem other
than that we only see this issue when the incremental compiler is enabled.

Bug: https://github.com/dart-lang/sdk/issues/39122, https://github.com/dart-lang/sdk/issues/38102
Change-Id: Iaabb4497d6da69684692c1d7b9c030c59ebc6072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123001
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2019-10-31 16:57:44 +00:00
Paul Berry a0ee662b7b Move shared analyzer/FE integration test data into shared package.
This moves the five test suites for flow analysis along with the
constants test suite.

Note that a few files have formatting errors.  I'll fix those in a
follow-up CL.

Change-Id: Ie9bba74c7d91e49ac6c9d3c64a96be007b6a94c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-31 15:02:03 +00:00
Johnni Winther 6b61050d9c [cfe+analyzer] Split generated message files into shared and cfe-only
Change-Id: I71dff57403d236f6186d7e1b5fa01fa7149fd0f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123661
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-31 14:39:04 +00:00
Paul Berry 5b4612bc68 Move front_end/lib/src/base/errors.dart into _fe_analyzer_shared package.
Change-Id: I9369e8dbf7b5d6fff9ad2a74346871b3e274e8ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123640
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-31 13:05:53 +00:00
Paul Berry 29ab43e0e2 Move flow_analysis tests into package:_fe_analyzer_shared.
Change-Id: I3f95b1124ceb5c465a88e30bd161c0a2832a9772
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123625
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-31 13:05:53 +00:00
Paul Berry 499815842c Create a package to hold code shared between front_end and analyzer.
Previously such shared code was in the front_end package, but that
created problems because there is a lot of code in front_end that
isn't intended to be shared with the analyzer (including, notably, the
dependency on kernel).

This CL just moves over the flow_analysis logic to the new shared
package.  Follow-up CLs will move over other shared logic and tests.
The end goal is that the analyzer package will no longer have a
dependency on front_end.

Change-Id: I5642d6565204422d79808ca47648462db85e442a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123624
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-31 13:05:53 +00:00
Johnni Winther d76ffbc149 [cfe] Handle assigned variables in for and for-in
Change-Id: I06deda7f017dcd40e5c6987c61261cf3be2be0ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123410
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-31 11:36:43 +00:00
Kallen Tu 44641fbd61 Added variance support in bounds inferencing.
Change-Id: Id3d05445491650642c40ac8d9b1ecf58162c56f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122485
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-10-30 20:35:23 +00:00
Paul Berry d50c158d42 Flow analysis: fix analyzer "desugaring" of try/catch/finally statements.
Flow analysis requies the client to desugar a try/catch/finally
statement into a try/catch statement nested inside a try/finally
statement (or, in the analyzer's case, to make calls to flow analysis
as though such a desugaring has been done).  The analyzer was doing
this incorrectly:

- It was always calling the flow analysis methods for try/catch, even
  if there were no catch clauses present.

- When calling tryFinallyStatement_finallyBegin for a
  try/catch/finally statement, it was passing in the node associated
  with the original try block (prior to "desugaring").  It needs to
  pass in the node associated with the desugared try block (which
  includes the catches).

Includes a similar fix in the migration engine.

Fixes #39178.

Change-Id: I16440e71d4964b9905fc2316380c8c98f14b13f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123506
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-30 16:30:04 +00:00
Jens Johansen fa05fedd89 [CFE] Parser test suite prints messages prettily at top of expect file
Change-Id: I9af28f57f8ab54b38e34b06019000b720e5fdecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123524
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-30 14:25:54 +00:00
Paul Berry f30b494035 Flow analysis: add the ability to defer storing node info in AssignedVariables.
This is needed by the front end, since it sometimes finishes parsing a
construct before creating the kernel representation of it, so it needs
to defer storing the node info for that construct until it creates the
kernel representation.

Change-Id: I2a59f08a228b6fed2af711cc0f06576ddc99a054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123505
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-30 12:25:54 +00:00
Johnni Winther 3ccdb01fc9 [cfe] Handle extensions exported through multiple libraries
Closes #39160

Change-Id: I605b1a95ddab822848b33244b3130ebf16b69842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123523
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-30 11:59:44 +00:00
Jens Johansen 92d3098b92 [CFE] Make spell checker more friendly
- Don't state that any word not found in the dictionary is a misspelled
  word. Instead say it's not found in the dictionary. If the word was
  found in the blacklist, say that.

- Offer alternative spellings if a word in the dictionary is 'close'.
  E.g. if I typed 'explicitley' offer 'explicitly' as an alternative.

- Tell where the dictionaries are located to make it easier to add new
  words.

Change-Id: I85ee622ffd8a36c7d77b82cb64809ec005f5fefb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123522
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-30 11:54:54 +00:00
Paul Berry 9be1920abf Flow analysis: Fix AssignedVariables handling of try/catch/finally in analyzer.
A corresponding fix needs to be made to the front end as well.  For
now I've used the "analyzer." and "cfe." prefixes in the test case to
note the differences.

Change-Id: I00d42b224577dea67ee198a3c68c775b631e2b29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123504
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-30 11:46:14 +00:00
Jens Johansen c791aa880c [CFE] Fix parser crash when recovering from missing operator and having a return type
Fixes #39026

Change-Id: I2eb5620017f6c52e8a06248a8c2ed9f2eb196f9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-30 11:14:44 +00:00
Paul Berry 5837107613 Flow analysis: add AssignedVariables.discardNode method
This will need to be used by the front end's body builder to properly
record assigned variables for a try/catch/finally statement.

Change-Id: Ia0cda160e524f6dc52c19362cc35b6f405eca993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123501
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-30 10:54:45 +00:00
Paul Berry d3a5b82355 Spell checking: allow "`" as a delimiter in code.
This is needed in order to spell check the comments added in
https://dart-review.googlesource.com/c/sdk/+/123501.

Change-Id: Iebb0c30ce806e0640d60236f7ce4b8dc80285b56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123502
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-30 09:28:35 +00:00
Jens Johansen 63b9a155f7 [CFE] Fix potential parser crash when parsing typedef
Fixes #39033.

Change-Id: I746e7b9c6bd531565721ad45954ee68e0ac392b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123403
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-30 08:16:37 +00:00
Paul Berry 12532e327f Analyzer ID test fix: annotate methods properly.
This avoids the need to special case test expectations for CFE in
pkg/front_end/test/flow_analysis/reachability/data/never_return_type.dart.

Change-Id: Ib754a76c96e73c8183b5ff10a2e7d2908e653a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-29 14:58:14 +00:00
Johnni Winther fc5d096617 [cfe] Make Scope.local, Scope.setters, Scope.parent private
+ improve type precision of setter and label maps in Scope.

Change-Id: I79e9b0c05dd3dbe38d9359c1f45e11f42fd584de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123255
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-29 14:45:44 +00:00
Johnni Winther b4198f3069 [cfe] Remove Builder.target
Change-Id: Ieb2d88d1014ed681d485052b4226d81351ce60fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123242
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-29 14:45:44 +00:00
Paul Berry 780af0fcfc Flow analysis: promote to "types of interest" on assignment.
This allows so-called "ensure guarded" promotions, e.g.
- `if (x is! int) x = 0;`
- `if (x == null) x = 0;`
- `x ??= 0;`

The latter two are particularly important to prepare for NNBD.

Change-Id: Ib53ca916e6d485945326b19e86f8cfb5b3ee2160
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-29 13:23:59 +00:00
Dmitry Stefantsov d213d3c736 [cfe] Start implementing reachability analysis involving type Never
Change-Id: I80edd4dd1b46b533a4f50243e1d3b18aa00f80ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123250
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-29 12:27:19 +00:00
Jens Johansen ea3cb7317a [CFE] Fix unescapeString crash
unescapeString would for instance crash if it got the string '"'
(without the quotes) (i.e. the single ascii character 0x22).

Fixes #39035

Change-Id: I0b6baba975b3e8a9279699027fde4b15cde4a5ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123249
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-29 09:38:46 +00:00
Johnni Winther c8ff1b0c21 [cfe] Add BlockKind to parse/begin/endBlock
... and use this to computed AssignedVariables data for try statements

Change-Id: I235575b055cb89b553baf0ac728d9954d8d0aaa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123251
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-29 09:17:06 +00:00
Johnni Winther 688454c4a7 [cfe] Compute AssignedVariables in body builder
For-loops and try statements currently not supported.

Change-Id: I52a591b55149ddfd5d0c5792239555d72b8146fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123248
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-10-29 09:17:06 +00:00
Johnni Winther eb04e0922b [cfe] Refactor CompoundPropertySet and add CompoundExtensionSet
Change-Id: Id6dda215cae88dc35943f34be4f210d148eace00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-28 14:08:42 +00:00
Jens Johansen a14bf89eb9 [CFE] Move old dill files to CIPD
Remove from git, add to CIPD, DEPS and gclient sync.

Change-Id: Ib215f51a53108c56c2b129de3fdb156814a31a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123245
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-28 14:07:18 +00:00
Paul Berry 29a040ac55 Flow analysis: Add a clarifying comment to tryCatch assigned_variables test
Change-Id: I58211cd8acc95aea9459513ad1bf4951a8b3bcff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123260
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-28 13:59:07 +00:00
Paul Berry e1fce75301 Flow analysis: clean up unit tests using custom matchers.
Previously, we made heavy use of operator== in the flow analysis
tests.  But we also tried to verify that the flow analysis engine
didn't compare types with operator==.  This was kludgy, because it
meant that we had to use a global variable to keep track of whether a
use of _Type.operator== should succeed.  It was also kludgy because it
required an implementation of operator== in flow analysis code that
was solely meant for testing.

By using custom matchers, we can get the same level of testing
flexibility without making use of operator== anywhere.

Also, fixed a few flaws in the tests for "join".  They were
accidentally setting up variables in the already-written state, so the
"assigned" subtest was passing in spite of incorrect expectations.

Change-Id: If326678aeb20a62433ad090968e150738ba5dc59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-28 13:59:07 +00:00
Jens Johansen 5b7c981086 [CFE] Parser test framework also outputs token stream
This makes it much easier to see what the parser is actually working
with in the face of token stream rewrites.

Change-Id: Ic336f18fab7c8fd7a42020b32af4a480bbde25bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122865
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-28 10:25:30 +00:00
Paul Berry 9f25d0e1d8 Flow analysis: don't necessarily clear promotions on assignment.
If the RHS of an assignment is a subtype of the current promoted type
(or one of the previously promoted types), any relevant promotions are
kept.

So for example:

  if (x is int) {
    x = x + 1; // Still an int!
    print(x.isEVen); // ok
  }

This required two significant changes:

- Clients must now tell the flow analysis engine the type of the RHS
  of the assignment.  This required some refactoring in the analyzer,
  because this information wasn't always easily available at the point
  where we were calling flow analysis.

- The flow analysis engine now has to keep track of a "chain" of the
  currently active promotions, so that it can potentially un-do some
  promotions but not others.  This meant that the algorithms for
  "join" and "restrict" had to be reworked.

In a future CL I'll add the ability for assignments to promote to
types that have been previously checked against ("types of interest"),
e.g.:

  if (x is! int) {
    x = 0; // x is now an int!
  }
  // x is now known to be an int because it's promoted in both branches

Change-Id: I63d6c9a2021b045d391b2d9c674e9a2e5f770e62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123003
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-26 20:38:28 +00:00
Paul Berry 93afae8d0c Flow analysis: fix AssignedVariablesVisitor treatment of for-each loops.
Change-Id: Icd05b63d1a92f2065de1c04583be9bb47c14bbd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-26 18:50:18 +00:00
Dmitry Stefantsov 9910fa8454 [cfe] Implement the first part of NNBD-aware isSubtypeOf
This CL is a squashing of the following smaller CLs:

* https://dart-review.googlesource.com/c/sdk/+/120669/
* https://dart-review.googlesource.com/c/sdk/+/120670/
* https://dart-review.googlesource.com/c/sdk/+/121331/
* https://dart-review.googlesource.com/c/sdk/+/121381/
* https://dart-review.googlesource.com/c/sdk/+/121383/
* https://dart-review.googlesource.com/c/sdk/+/121620/
* https://dart-review.googlesource.com/c/sdk/+/121707/
* https://dart-review.googlesource.com/c/sdk/+/122144/
* https://dart-review.googlesource.com/c/sdk/+/122360/
* https://dart-review.googlesource.com/c/sdk/+/122381/
* https://dart-review.googlesource.com/c/sdk/+/122783/
* https://dart-review.googlesource.com/c/sdk/+/122787/

Change-Id: I9d850f531f0fce07055ff9b5cd39abb605752005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122868
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-25 16:37:39 +00:00
Paul Berry 0167f91012 Flow analysis: introduce ID tests for AssignedVariables.
This should make it easier to verify that the CFE implementation is
correct.

Note that this effort encountered a few bugs in the analyzer
implementation, which are marked with TODOs.  I will fix them in
follow-up CLs.

Change-Id: Ic164a1cf214b5730f848b17db2838c29d25b00d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122850
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-25 13:44:05 +00:00
Paul Berry 5ba6fb73ec Only use "stmt:" prefix when necessary to avoid ambiguity.
This makes the analyzer test behavior consistent with the CFE.

Change-Id: I5b7739632e08552aa3092a2b7ea6831ecad51ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122981
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-25 13:44:05 +00:00
Johnni Winther d576ce69e1 [cfe] Implement initial integration of reachability
This CL is based on:

https://dart-review.googlesource.com/c/sdk/+/122397
https://dart-review.googlesource.com/c/sdk/+/122500
https://dart-review.googlesource.com/c/sdk/+/122399

Change-Id: Id5474e5338f3d04e6710015b9d1cc1baec93e7ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122861
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-25 09:53:34 +00:00
Jens Johansen 2d0cdbdd12 [CFE/Incremental compiler] Don't crash on parts with invalid scheme
Before this CL a part like "part ' package:foo/bar.dart';" would crash
the incremental compiler because the part specifies a scheme that is
invalid.

Change-Id: I567df0a68ff8709e4ca95d24e6dabc4d959c95fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122862
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-25 09:27:24 +00:00
Karl Klose 81a2925ac2 [infra] Front-end unit tests: Check for timeout of each suite separately
This CL also improves the printed messages to include full suite name
and timings.

Change-Id: I7e2129fb27a91e6ab56269f0ef4ed2c80bf4e786
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122788
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-10-25 07:23:14 +00:00
Johnni Winther 1bc9fba660 [cfe] Allow this access in late field initializers
Change-Id: Ia2139e3e87a4b141b5e0df41541bab5f74acd5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-24 18:11:17 +00:00
Paul Berry 696a374b6f Flow analysis: properly handle the fact that ++ and -- are assignments.
Change-Id: Ie54fbf7c7c750457b2750de90c64e8ea32db15d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122730
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-24 17:57:27 +00:00
Paul Berry 8f5a45c22d Flow analysis: add support for ??=.
Change-Id: I8c99c42cf3a2560d7af3daf27ee316e22a2eb027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122588
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-24 17:57:27 +00:00
Paul Berry b7911e4490 Flow analysis: add support for asserts.
Fixes #38761.

Change-Id: I6cc4adc0383cc56d99fa73ef75f728db0c56063b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122732
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-24 17:01:33 +00:00
Paul Berry 1bd6e20d76 Flow analysis: simplify the use of AssignedVariables.
Previously, the client was responsible for querying AssignedVariables
to find the variables assigned and captured during constructs like
loops, and passing that information into FlowAnalysis methods.  With
this CL, the client simply passes AssignedVariables into the
FlowAnalysis constructor, and the lookup happens automatically.

Change-Id: Ifbbf8ba8ea0d0f8a31d41244892c8c816eea56dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122731
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-24 13:00:50 +00:00