Commit graph

52887 commits

Author SHA1 Message Date
Dan Rubel 1231e90fee Code complete identifiers not directly referenced by the analyzer AST
The fasta parser sometimes "drops" unexpected tokens during recovery.
When this happens, the dropped or skipped token is not reported to
the listeners, and thus does not become part of the analyzer's AST.
These tokens are still in the token stream, but will not be found
by the existing CompletionTarget mechanism.

For example, the fasta parser parses
'if (v i) {}' as 'if (v) {}' and drops the 'i' token.

This CL introduces a new CompletionTarget.droppedToken field.
If a keyword or identifier has been dropped by the parser,
but overlaps the code completion offset, then that token
is placed into this new field.

In the example above, when code completing the 'i',
the CompletionTarget will now be
containingNode = '(v)'
entity         = ')'
droppedToken   = 'i'

Change-Id: I15e43529ab4a72de9500c521be278fa13ae68d99
Reviewed-on: https://dart-review.googlesource.com/31285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-22 21:55:35 +00:00
Siva Chandra 914720524a [gen_snapshot] Do not add any dependency file in the kernel flow.
Adding a dependency file triggers resolving its file path using the
service isolate. However, in the kernel flow, gen_snapshot does not
initialize the service isolate. This does not seem to cause any problems
on Mac and Linux, but flutter crashes on Windows. On Linux and Mac,
the behaviour with this change matches the current behavior.

The correct dependency file to add to the dependencies file in the kernel
flow is the app dill file passed as input to gen_snapshot. But, this would
call for specifyint the application sources as the dependency for the app
dill file itself somewhere. We can revisit this and fix it up correctly if
needed. For now, this change unblocks the Windows builds.

Change-Id: Ic22a7ccc96548e005b85308c3baaeedb860f4dae
Reviewed-on: https://dart-review.googlesource.com/31280
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-12-22 21:07:44 +00:00
Régis Crelier eb7454cb20 [VM runtime] Where possible, use constant cid instead of object store lookup to
recognize types.
Reorder checks for faster recognition of Future and FutureOr classes.

Change-Id: Id9e1c3a2e6c1fe274ac1d993f7a28271f207f48d
Reviewed-on: https://dart-review.googlesource.com/31282
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-12-22 20:34:45 +00:00
Régis Crelier f3307ca8de [language tests] Fix 2 strong mode tests related to covariant tear-offs.
Update status files.

Change-Id: I5828a86f268a767d72dddea36e009950ac5dabde
Reviewed-on: https://dart-review.googlesource.com/31401
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-12-22 20:33:36 +00:00
Emily Fortuna 21891a965f Do id equivalence testing for deferred imports.
Also allows us to more generally compare annotations in multi-file tests.

Bug:
Change-Id: I2f4ac34b918cc80400ebc417dfcc2caf56457ac2
Reviewed-on: https://dart-review.googlesource.com/30923
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-22 20:04:44 +00:00
Bob Nystrom 2114ba391d Mark dart2js test as crashing.
Change-Id: I1507ca7df35c6f8ef5a770e51e97a10dee494326
Reviewed-on: https://dart-review.googlesource.com/31380
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-12-22 18:21:03 +00:00
Régis Crelier b7b1054fda [VM runtime] Add comments and refactor code handling void as result type in
function subtype test.
No behavior change, only make code easier to read in strong vs non-strong modes.

Change-Id: I44b34ff5c9680270014db83633eb2ef1ed60491e
Reviewed-on: https://dart-review.googlesource.com/31284
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-12-22 17:11:14 +00:00
Alexander Aprelev d9173c0949 Sanitize file path before sending it to frontend.
This is important on Windows, where file path has to be massaged before processed as uri.

Bug:dartbug.com/31706
Change-Id: Ifa91d4b99ed443f4c3409a343b797211f578403d
Reviewed-on: https://dart-review.googlesource.com/31281
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-12-22 17:09:24 +00:00
Brian Wilkerson ad59598a94 Fix tests to pass on Windows
Change-Id: I37cb7e9772a636015b001d634474764bea140cc5
Reviewed-on: https://dart-review.googlesource.com/31360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-22 16:18:01 +00:00
Erik Ernst 3698b91be8 Added test directories for Dart 2 features.
At and after the meeting that Anders called in AAR today we discussed
the list of directories that we would need. These came up:

  generalized void
  instantiate to bound
  noSuchMethod forwarding
  super-bounded types

I combined super-bounded types and instantiate to bound into one
topic, since they are so interwoven.

I also noted that we have more features coming up, even though we have
not discussed them much recently, and one of them will need a number
of tests: optional const/new. So I created new test directories for
these five topics, and added a short README.md to indicate their
purpose.

Change-Id: I17a407073d2dbcbccce0bfbd321cb01365d4b9ee
Reviewed-on: https://dart-review.googlesource.com/31200
Reviewed-by: Anders Sandholm <sandholm@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2017-12-22 15:39:13 +00:00
Johnni Winther 71bfc9e849 Reenable swarm_test
Change-Id: I2f6439561762c6ed1db0ef0e6f189fa79db16865
Reviewed-on: https://dart-review.googlesource.com/31141
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 13:35:32 +00:00
Johnni Winther c9fc2e7e40 Use a temporary dir for stepping_test
Change-Id: I474552f4c77e4c8a28c545710e823c203c6a51d5
Reviewed-on: https://dart-review.googlesource.com/31340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-22 13:30:27 +00:00
Johnni Winther 452205c73d Move unittests, part #6 of ?
Change-Id: I328f5d1fdcd9489005236d8db39fe213cc08b1ce
Reviewed-on: https://dart-review.googlesource.com/31142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 13:08:51 +00:00
Johnni Winther 9cfbaa4367 Port unittest, part #6 of ?
Change-Id: Ide0ff2b012c48c3017e68cfcfaf1d681e12fd5c8
Reviewed-on: https://dart-review.googlesource.com/31140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:39:29 +00:00
Johnni Winther c563d7845b Move unittests, part #5 of ?
Change-Id: I38c6a3f9c6c2620cc893ddef23bdc1e3a8bcb411
Reviewed-on: https://dart-review.googlesource.com/31061
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:23:38 +00:00
Karl Klose 38c4eff017 Add dart2js target to fasta CLI
Change-Id: I28cbfcebb75f698493cba64d1dfa6484832ed70d
Reviewed-on: https://dart-review.googlesource.com/31300
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-12-22 12:13:52 +00:00
Johnni Winther 9fe7c0e806 Port unittests, part #5 of ?
Change-Id: I58c9deea426072907a5d02f61f23f138b1f50c1d
Reviewed-on: https://dart-review.googlesource.com/31101
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:11:47 +00:00
Aske Simon Christensen de2ce48e17 Finish type variables earlier so their bounds are available when building the program.
Check bounds in verifier.
Fixed an inconsistency in the printing of parent nodes in the verifier.

Closes https://github.com/dart-lang/sdk/issues/30838
Closes https://github.com/dart-lang/sdk/issues/31213
Closes https://github.com/dart-lang/sdk/issues/31700

Change-Id: I328ca2c5bfa01a6753a806abd2510c98fa2b7cfe
Reviewed-on: https://dart-review.googlesource.com/22500
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-22 11:06:52 +00:00
Bob Nystrom 0e2ca151e0 Disable analyzer warning on special 'dart:_internal' import.
Change-Id: Ic8c2519555dd0159ff85581d1669cdf0703332ca
Reviewed-on: https://dart-review.googlesource.com/31242
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-12-21 23:21:04 +00:00
Sigmund Cherem d85651846f Update .status files
One language test "passes" when we no longer complain about the mixin issue.

Bug:
Change-Id: I5aeb4ead7d3faf6ec756eeb11fecc20bcfb4c16e
Reviewed-on: https://dart-review.googlesource.com/31260
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 22:49:02 +00:00
Sigmund Cherem f404b59d1f Disable multi-inheritance error when using the kernel FE
Workaround for Issue #31118

Change-Id: I1d19eb1adeb7236501c276eeee5446ada36115a3
Reviewed-on: https://dart-review.googlesource.com/31240
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-21 21:33:03 +00:00
Brian Wilkerson 48eb23149a Attempt to fix Windows bots (TBR)
Change-Id: Ieccd570d9472a457a7fa0acece121eba6bfa71e7
Reviewed-on: https://dart-review.googlesource.com/31241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 21:02:08 +00:00
Sigmund Cherem 4dfa6a4b9c Add flag to truncate summaries.
Also remove "trimDependencies".

For context: see issue #31704 (https://github.com/dart-lang/sdk/issues/31704)

Change-Id: Iedce40fac9ed974850b41145e531d08aeccee87b
Reviewed-on: https://dart-review.googlesource.com/30963
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-21 20:00:21 +00:00
Brian Wilkerson 4f20827afb Class to analyze the contents of a pubspec file
Change-Id: Ia45e1c4ad63cd7a72d623f586760c1928e4ac9b8
Reviewed-on: https://dart-review.googlesource.com/31220
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 19:56:31 +00:00
Sigmund Cherem 5e4ec2c8ab bazel worker fixes: add flag to set multi-root-scheme, resolve input uris correctly
Bug:
Change-Id: I4d680bdb56f54479cbf423dc1bc29dcdb6e273f6
Reviewed-on: https://dart-review.googlesource.com/30926
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-21 19:49:11 +00:00
Roland McGrath f3581accf2 [GN] In Fuchsia build, use symlink for host dart-sdk/bin/dart copy
This solves some arcane issues with Fuchsia's GN complexities,
explained further in the comments.  It obviates "copy_dylibs".

Change-Id: If1b26bfa73d5167550d2217258fa074b9dacade9
Reviewed-on: https://dart-review.googlesource.com/30924
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-21 19:34:41 +00:00
Sigmund Cherem 22298629e8 Add unstable API for bazel summary worker and move the actual worker out of package:front-end
Bug:
Change-Id: I0a64d3de46ef55e8185e723d6111fa315ad286ca
Reviewed-on: https://dart-review.googlesource.com/30621
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-21 19:09:11 +00:00
Sam Rawlins fc297daf5a Bump dependency on shelf_static
This bump is primarily to remove the dependency on scheduled_test. (The
dependents only include barback, shelf_static, and watcher.)

Change-Id: I1e40da2798a539d596b99688150d74934a0626e4
Reviewed-on: https://dart-review.googlesource.com/30980
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-12-21 18:12:41 +00:00
Brian Wilkerson c2f029ccf9 Remove another unused parameter and cleanup TODOs
Change-Id: I5f8e62abf2cd476ce026c4fdde45755de0c79cc6
Reviewed-on: https://dart-review.googlesource.com/31180
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 18:10:21 +00:00
Aske Simon Christensen 43b1c68803 Error on super as expression
Report error when super is used as an expression outside
an initializer. Consolidated some error messages.

Change-Id: Iafaeeeff8a4b72f941925cefcbc832ba47f02a79
Reviewed-on: https://dart-review.googlesource.com/23360
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-21 17:25:51 +00:00
Dan Rubel 63fa6f24a5 Add fasta parser for statement var recovery
Change-Id: I58b54e757e9deede69ecba5a5d4fa200efdb09fa
Reviewed-on: https://dart-review.googlesource.com/30920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-21 16:55:01 +00:00
Alexander Thomas a8e0c63e55 [Infra] Delete generated compilations for dartk/dartkp compilers as well
This should prevent the bots from running out of disk space.

Change-Id: I3ca7794f8006f616473cf02c62f000a4c44d5b36
Reviewed-on: https://dart-review.googlesource.com/31120
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-12-21 16:18:21 +00:00
Dan Rubel 3392f32e50 Update code completion of async keywords
This updates the KeywordContributor for use with the fasta parser
and cleans up several code completion tests by introducing
a 'usingFastaParser' flag.

Change-Id: Ife2d945065c23ccd9f2d8e85e5c24a6b956c75ae
Reviewed-on: https://dart-review.googlesource.com/30902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-21 15:36:11 +00:00
Brian Wilkerson d5d43e23c5 Add more partial code tests
Change-Id: Ie4d2b9957a355dd2555f9258649bb7091449bf8f
Reviewed-on: https://dart-review.googlesource.com/30962
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 15:27:42 +00:00
Brian Wilkerson fe031dea8e Remove support for generic comment syntax from fasta parser
Change-Id: Ic9d61a19d03ff537d58fa378d992e02de903bad8
Reviewed-on: https://dart-review.googlesource.com/30921
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 15:18:11 +00:00
Johnni Winther 2a06996361 Fix printer_callback_test
Change-Id: Ib2f71309ae0b5eee1a3c2df757d7f2c3fe77e144
Reviewed-on: https://dart-review.googlesource.com/31121
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-21 14:30:49 +00:00
Samir Jindel 7a9ec34310 [kernel] Fix Procedure constructor.
Change-Id: I640fb932f16d45f3ec97d2c498a32ac16b466df7
Reviewed-on: https://dart-review.googlesource.com/31060
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-12-21 14:19:17 +00:00
Johnni Winther a521c7f255 First step debugging tests.
Change-Id: I8a947999778f851ed38c1a9fb518af00664f19ec
Reviewed-on: https://dart-review.googlesource.com/30740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 14:03:51 +00:00
Alexander Thomas a3f6eefdbf Revert "[Infra] Remove all sharded builders from the CQ to restore service"
This reverts commit d049b771a6.

Change-Id: I41788cebb092e59364fcecbf532e35873d1db9ff
Reviewed-on: https://dart-review.googlesource.com/31020
Reviewed-by: William Hesse <whesse@google.com>
2017-12-21 12:38:49 +00:00
Johnni Winther 6d40c7629e Move unittests, part #4 of ?
- add 'deferred' folder for deferred load tests

Change-Id: I60b07b09df80bf6c8d3df6dcec9bce12bdcbafb8
Reviewed-on: https://dart-review.googlesource.com/30862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 10:24:49 +00:00
Johnni Winther 7500aed44d Port unittests, part #4 of ?
Change-Id: I0eb45671f9721eb0ad76444fb928f4e8ed96cd25
Reviewed-on: https://dart-review.googlesource.com/30860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 10:17:39 +00:00
Johnni Winther 1fc66812bf Move unittests, part #3 of ?
- add 'async_await' folder for testing async/await transformation
- add 'codegen' folder for testing of generated code
- add 'end_to_end' folder for testing of command-line interaction

Change-Id: Ic262db98d6156175bf53fcc53443cc2b273dd404
Reviewed-on: https://dart-review.googlesource.com/30780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 10:00:14 +00:00
Erik Corry 8d58c13ca2 [VM] Use new Write barrier filters.
R=vegorov@google.com

Bug:
Change-Id: Icec38f730157448b47f5bf5a43dc582e4064e98e
Reviewed-on: https://dart-review.googlesource.com/30861
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-12-21 09:59:03 +00:00
Johnni Winther 289671e38e Port unittests, part #3 of ?
Change-Id: If5174e76187d2e045cb14b11df932acdee9e42dd
Reviewed-on: https://dart-review.googlesource.com/30761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 09:35:06 +00:00
Kevin Moore 9e8a3e2d31 Bring in the latest pub
Change-Id: I8e482110392180f82ef83106583f64d396a39480
Reviewed-on: https://dart-review.googlesource.com/30961
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2017-12-21 04:22:52 +00:00
Régis Crelier ac4dfc7672 [gardening] Update status file.
Change-Id: Ia4a28442b28d2d62d22d4c29e18515c9085ada93
Reviewed-on: https://dart-review.googlesource.com/30925
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-21 00:07:10 +00:00
Alexander Thomas d049b771a6 [Infra] Remove all sharded builders from the CQ to restore service
This reverts commit 102a3c8e72.

TBR=whesse@google.com

Change-Id: Ifa7e5c06a727abd77a2a4c8d174b75df8de817ff
Reviewed-on: https://dart-review.googlesource.com/30940
Reviewed-by: Alexander Thomas <athom@google.com>
2017-12-20 23:26:51 +00:00
Régis Crelier e8fc3ab0fa [gardening] Update status files.
Change-Id: I0f3eeaffebebb9ed2869aed01ad5f46f9ee81a8c
Reviewed-on: https://dart-review.googlesource.com/30922
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-20 23:03:10 +00:00
Zachary Anderson 8c21a6dd6b [GN] Use the prebuilt toolchain to build analyzer summaries
This will speed up cross-builds.

TO-660

Change-Id: Idb1bf8839ffc3443ff620fbe94b733fe71d6bf84
Reviewed-on: https://dart-review.googlesource.com/30901
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-12-20 22:03:39 +00:00
Andrew Davies fcc6836b88 [dart vm] Add in call to time svc for UTC offset
Dart VM will now call the time service to get the UTC offset.

Change-Id: Iec5f1a375d1fbc00c534eed10c8f1ba6b01e87a2
Reviewed-on: https://dart-review.googlesource.com/20824
Reviewed-by: Zach Anderson <zra@google.com>
2017-12-20 21:59:13 +00:00