Commit graph

18697 commits

Author SHA1 Message Date
Paul Berry c567790306 Clean up closure return type handling during front end type inference
This CL fixes two minor flaws in the type inference of closure return types:

- inferReturnType needs to call _wrapAsyncOrGenerator prior to
  checking whether the inferred return type is a subtype of the
  context.  This is necessary because for async and generator
  functions, the context type is the "wrapped" type (FutureOr<>,
  Iterable<>, or Stream<>).

- _updateInferredReturnType needs to perform implicit downcasts before
  storing the inferred return type.  This is necessary because if in
  implicit downcast is added, the inferred type that should be stored
  is the type that was downcast to.  In order to make this work, the
  "unwrapping" logic needed to be moved from
  _updateInferredReturnType's two call sites into
  _updateInferredReturnType itself.

These flaws were benign because they were masked by the looseness of
the future flattening operation.  They need to be fixed so that future
flattening can be made more precise.

Change-Id: I2b5ea3f63632638b5fadbce7d52c5d028acda5ab
Reviewed-on: https://dart-review.googlesource.com/34480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-12 22:07:20 +00:00
Johnni Winther c0e7f53041 Convert update_all.sh to a real language
Change-Id: I2b503694dab5b4d3f49f55bd83b9fb405b0f119b
Reviewed-on: https://dart-review.googlesource.com/34460
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 22:04:00 +00:00
Johnni Winther d539c78af1 Add source information to parameter stubs.
Change-Id: If942cc13203752361c3104c89190d75979073498
Reviewed-on: https://dart-review.googlesource.com/34440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 21:23:40 +00:00
Konstantin Shcheglov 59cbc09523 Infer () => null as returning Null.
Bug:
Change-Id: I5bf1f7c55825ddb6202422fc0025d983914c4823
Reviewed-on: https://dart-review.googlesource.com/34420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-12 21:02:20 +00:00
Siva Chandra 4b73d12082 Link kernel service dill with the command line dart executable.
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.

1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.

Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-01-12 20:40:41 +00:00
Mike Fairhurst 90f9fa5664 Fix #28513 Force an order of LUB/GLB on equivalent Top types.
A fairly internal case, so I ended up guarding it semi-heavily with
asserts, which could go against convention, but seems fairly safe here.

Two tests: One that sanity checks some edge cases & exemplary values,
and another one that checks each combination programmatically. Together
they should be the best coverage; both the reliance of computers and
the simplicity of specific cases.

Should be very easy to pop in the void type here next.

Bug: 28513
Change-Id: Id20811a77b4de3f2c4ede7a77e1da5a114432e97
Reviewed-on: https://dart-review.googlesource.com/34305
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-12 18:33:59 +00:00
Konstantin Shcheglov f79596c0ff Switch from ForwardingStub to Procedure.forwardingStubInterfaceTarget.
Fixes #31519

R=paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31519
Change-Id: I0e9634ba6a1413a758ff3376c69d530d4215b512
Reviewed-on: https://dart-review.googlesource.com/34261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-12 17:54:30 +00:00
Konstantin Shcheglov d380e888b5 Every enum has toString() method.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I48ca2da1099bee9cab7a8661d0b7be67eb568793
Reviewed-on: https://dart-review.googlesource.com/34307
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-12 16:59:20 +00:00
Johnni Winther 7568a4e4ce Don't register closure call methods
- closed world is incomplete anyway; we're missing the call methods from static and instance tear-off.

Change-Id: Ibd3fc9d80220bef3ee651bf529a487b617de7a6b
Reviewed-on: https://dart-review.googlesource.com/34144
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 11:47:18 +00:00
Johnni Winther 107f611d4e Support --disable-rti-optimization for --use-kernel
Change-Id: I47e1301629f068c12bd5ef898323fc86804bf4a0
Reviewed-on: https://dart-review.googlesource.com/34160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 11:37:49 +00:00
Lasse Reichstein Holst Nielsen ffab960f19 Add Expect.notIdentical and Expect.allDistinct to package:expect.
Change-Id: I8d3c92a4723f74b40b8c0c968340d1dd1175d748
Reviewed-on: https://dart-review.googlesource.com/34061
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-12 09:33:16 +00:00
Jenny Messerly 9179fd5103 implement generic function instantiation in DDK
Change-Id: Id7307b7e8a31b96da3ac765a0936f7c7e675465e
Reviewed-on: https://dart-review.googlesource.com/34303
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-01-12 02:01:13 +00:00
Paul Berry d57633ce71 Revert "Fix handling of forwarding semi-stubs in the front end."
This reverts commit 379801ed11.

Reason for revert: Broke buildbots

Original change's description:
> Fix handling of forwarding semi-stubs in the front end.
> 
> See #31649 for more details about forwarding semi-stubs.
> 
> Change-Id: Iaf1153be5ac7f66503b93a362b66ac9585462f6c
> Reviewed-on: https://dart-review.googlesource.com/33820
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,dmitryas@google.com,sjindel@google.com,kmillikin@google.com

Change-Id: I6b37f1143183e889a5b52cb8b0a5427991b306c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/34280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-11 22:05:09 +00:00
Dan Rubel 8a0a6b5a98 Update analyzer fasta parser test expectations
In addition to updating test expectations, this CL also
* Streamlines parsing modifiers in 2 places
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/33500

Change-Id: Ia3d4b7db8a908455b533c1360d107d3557fbb36f
Reviewed-on: https://dart-review.googlesource.com/34200
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-11 21:57:58 +00:00
Mike Fairhurst 095232c71f Expansion of https://dart-review.googlesource.com/c/sdk/+/33660, which
solves the generic function type scoping problem (fixes the test).

Includes further failures documented here:
https://github.com/dart-lang/sdk/issues/31804 with @failingTests.

These do seem to fail today as is, so it should be safe to land.

Bug:
Change-Id: Ice384b6fee35f1b1c4235bb0e4de7a90e2379937
Reviewed-on: https://dart-review.googlesource.com/33582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-11 21:45:48 +00:00
Alexander Markov 8fc7050f4f [vm/kernel] Global type flow analysis
Global type flow analysis is a whole-program type inference on
strong-mode kernel AST which is aimed at inferring various properties
useful for optimizations, such as non-nullability, exact types and
monomorphic call targets.

Issue: https://github.com/dart-lang/sdk/issues/30480

Change-Id: Ie2e6e642dfacdb562a3341f8d2bbaf69ca829319
Reviewed-on: https://dart-review.googlesource.com/30903
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-11 21:33:08 +00:00
Konstantin Shcheglov b7eb0241ee Push UnknownInferredType for implicitly types for-in variables.
This fixes a problem introduced in:
https://dart-review.googlesource.com/c/sdk/+/32861

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I9c8637dd7671dbf409cabbe3a707e615b2e553a2
Reviewed-on: https://dart-review.googlesource.com/34223
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-11 20:56:59 +00:00
Paul Berry 379801ed11 Fix handling of forwarding semi-stubs in the front end.
See #31649 for more details about forwarding semi-stubs.

Change-Id: Iaf1153be5ac7f66503b93a362b66ac9585462f6c
Reviewed-on: https://dart-review.googlesource.com/33820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-11 16:20:58 +00:00
Samir Jindel 96381b76bc [kernel] Introduce 'forwardingStubInterfaceTarget' field for Procedures.
First step in fixing issue #31519.

Change-Id: I8df86954993ae5edd59ad2edc57179725880c1d9
Reviewed-on: https://dart-review.googlesource.com/34143
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-01-11 15:31:48 +00:00
Samir Jindel e9daa98653 [fasta] Remove unnecessary unary negation for the minimum 64-bit integer.
Change-Id: I5ebf49427ac4ddd005c490d1f04880f005211d26
Reviewed-on: https://dart-review.googlesource.com/33943
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-11 15:31:01 +00:00
Alexander Thomas 813be084dd [infra] Normalize pkg.status
Change-Id: I656880ceb89bfe3e5588d035d2c1a452580c2e95
Reviewed-on: https://dart-review.googlesource.com/34104
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-01-11 14:33:48 +00:00
Alexander Thomas db99248e77 [infra] Normalize comments in pkg.status
Change-Id: Ia90ecd801c4d63c434c3b3fa220f59ff8c054e08
Reviewed-on: https://dart-review.googlesource.com/33886
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-01-11 12:13:15 +00:00
Aske Simon Christensen 4553cdeeb6 Support data URIs in StandardFileSystem.
Closes https://github.com/dart-lang/sdk/issues/31594

Change-Id: I8dad1429d91cc5934b37cb0be60d1e4039293b71
Reviewed-on: https://dart-review.googlesource.com/33461
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-11 11:23:36 +00:00
Aske Simon Christensen 9bdcc40f69 Rename PhysicalFileSystem to StandardFileSystem.
Preparation for data URI support. For clarity, this is just a rename.

Change-Id: Ibbd8da05d1a7106b5ec7c0ea9c1e13a95a89d1bd
Reviewed-on: https://dart-review.googlesource.com/33460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-11 11:23:25 +00:00
Jens Johansen 5e5550422f [kernel] Remove unnecessary "skip" of perf_test
Issue 28698 updated 3 status file entries. 2 entries are now gone,
and the last one doesn't seem to be current anymore.
This CL removes the remaining - unnecessary - entry.

Bug:
Change-Id: I38c8339e83c00d4be33ce84abc1c12f0b5ebe181
Reviewed-on: https://dart-review.googlesource.com/32771
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-11 08:17:47 +00:00
Johnni Winther c7447281f7 Handle type argument to instance members.
Change-Id: I40404d2f6da74cbaed68e23bc2fab0ebfb3e2cc8
Reviewed-on: https://dart-review.googlesource.com/33724
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-11 08:13:28 +00:00
Jens Johansen 58ed2604af Fixup DDC test on Windows (attepmt #2)
Directory.current.path on Windows uses "\" and not "/" and does not
start with a slash.

Bug:
Change-Id: Id1b75ee0e3962c3531ba964aee9300025cdbcdca
Reviewed-on: https://dart-review.googlesource.com/34101
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-11 08:06:21 +00:00
Jens Johansen a35a676f39 Revert "Fixup DDC test on Windows"
This reverts commit 70020cd30d.

Reason for revert: Didn't quite work.

Original change's description:
> Fixup DDC test on Windows
> 
> Directory.current.path on Windows uses "\" and not "/".
> 
> Bug:
> Change-Id: I6ef789d586622f78d0401c1a892f6a475bf6d93a
> Reviewed-on: https://dart-review.googlesource.com/34100
> Reviewed-by: Jens Johansen <jensj@google.com>

TBR=dmitryas@google.com,jensj@google.com

Change-Id: Ied8897801005f1a1b83075c1fb2a0b905129bb18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/34001
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-11 08:04:38 +00:00
Johnni Winther 06e6f4d105 Add --disable-rti-optimization flag
- to separate rti implementation correctness from optimization soundness.

Change-Id: I0786dd45261d6f8cf1380f016bfb7c6f773df6b1
Reviewed-on: https://dart-review.googlesource.com/33880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-11 07:56:56 +00:00
Jens Johansen 70020cd30d Fixup DDC test on Windows
Directory.current.path on Windows uses "\" and not "/".

Bug:
Change-Id: I6ef789d586622f78d0401c1a892f6a475bf6d93a
Reviewed-on: https://dart-review.googlesource.com/34100
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-11 07:25:43 +00:00
Alexander Aprelev c352b2203b Add dart2.bat to accommodate running dart2 tests on Windows
Bug: https://github.com/dart-lang/sdk/issues/31707#issuecomment-356708044
Change-Id: I7e7f7515fec393b1403cf5f8da2d740771ff10b7
Reviewed-on: https://dart-review.googlesource.com/34025
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-01-11 01:35:17 +00:00
Vijay Menon 3a4a0fae4f test.py support for tests under pkg/dev_compiler
Change-Id: Ic68359907d3c58bbebe7e368a6e4ad24017c6504
Reviewed-on: https://dart-review.googlesource.com/33620
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-10 23:31:18 +00:00
Vijay Menon 09621f6724 Try to handle int64 mode errors on literal handling
Bug:
Change-Id: I55fabb8eb359dbc91b4848d25109af9344484ee5
Reviewed-on: https://dart-review.googlesource.com/32121
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2018-01-10 22:45:59 +00:00
Alexander Markov c67be1b896 [vm/kernel/aot] Devirtualize Object methods if receiver is non-nullable
Change-Id: Ib860d7218162fc384e6a4e3f100f4179cb20fde5
Reviewed-on: https://dart-review.googlesource.com/32668
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-10 22:40:29 +00:00
Stephen Adams f756c5e71d Print names for generic method type parameters in function type
- Added JS_GET_FLAG('STRONG_MODE') allow the code to be tailored to
the type system version.

 - Split type stringifying code into V1 (existing logic) and V2
(strong mode Dart 2.0 logic).

The V1 code will eventually be deleted.

Change-Id: I78db91796040b6ecfa1bd5d6a9d64bd4c2bc4bcf
Reviewed-on: https://dart-review.googlesource.com/33680
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-10 21:00:48 +00:00
Konstantin Shcheglov 2ba489c65a Fix resynthesize tests for Windows.
Fixes #31832

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31832
Change-Id: Ie0b1dd9742415fe9cf97b3d3843eeaf3af878308
Reviewed-on: https://dart-review.googlesource.com/33982
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-10 20:24:39 +00:00
Vijay Menon bedf7121e0 Wire build rules to generate ddc-kernel versions of SDK files
Change-Id: I7d39bce7a3382c7a332ecdc4886bb08dabfdf09a
Reviewed-on: https://dart-review.googlesource.com/33900
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-10 18:34:38 +00:00
Harry Terkelsen 3c77ef6738 Ensure types seen in annotations are resolved as they are seen
Change-Id: I138bb7904ff069f1b0df6c85d63ca6b7cbdaca3e
Reviewed-on: https://dart-review.googlesource.com/33664
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-01-10 18:08:59 +00:00
Konstantin Shcheglov 1514e3f276 Resolve labels while applying resolution.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1d50d251e04a51a1ba0c6038592982988c3281b2
Reviewed-on: https://dart-review.googlesource.com/33666
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-10 16:53:09 +00:00
danrubel ec3c098ee0 Cleanup fasta recovery tests
Change-Id: I832d1b28c075351340ef0e94be51eab34d669c10
Reviewed-on: https://dart-review.googlesource.com/33640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-10 14:30:38 +00:00
Dan Rubel 729e7b2920 Refactor fasta parser modifier recovery
This CL extracts parsing modifiers from parsing types so that
parseModifiers just parses modifiers and a separate call is made
to parseType.

* Discard the ModifierContext object sooner
* Remove some places where findMemberName output was being
   used to determine which modifiers are present.

Currently, modifiers are parsed once by findMemberName,
again by parseModifiers, and sometimes a third time
by isFactoryDeclaration. This CL sets the stage for
improved modifier recovery and parsing modifiers exactly once.

Change-Id: Ieb8cd1156ed090ca4653258bd40afbac843b9b7c
Reviewed-on: https://dart-review.googlesource.com/33500
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 14:30:38 +00:00
Dmitry Stefantsov 28757928b4 Run instantiate to bound on a per declaration basis, not per use basis
Change-Id: I59764334cb1befda9e0db0fd09fc83f6398f61da
Reviewed-on: https://dart-review.googlesource.com/32960
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 11:34:59 +00:00
Dmitry Stefantsov 613c248a6d Skip resynthesize_kernel_test for now, until the timeout issue is solved
TBR=athom@google.com,jensj@google.com

Bug: http://dartbug.com/31832
Change-Id: I675be8bd7432f598d80ac79126f53ddfad318e42
Reviewed-on: https://dart-review.googlesource.com/33740
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-10 08:30:18 +00:00
Samir Jindel 28a0706e91 [kernel] Implement correct semantics of forwarding stubs in VM
This revision has been factored out of Revision 29300.

Change-Id: Idf579f0e5ffeea5764e2a9654c6812d69f6977c7
Reviewed-on: https://dart-review.googlesource.com/31921
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-10 07:39:31 +00:00
Peter von der Ahé bb9af782a7 Correct type arguments for NSM
Change-Id: I28623bed9d5d203e82d50c4b057803a89e76757d
Reviewed-on: https://dart-review.googlesource.com/33380
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-10 07:13:30 +00:00
Jens Johansen 11358378be [kernel] Change offset for IndexAccessor invocations
Add Observatory test to check debug positions for e.g. a[0]().
Non-kernel pipeline points to '(', whereas the (old) kernel behaviour
was to point to 'a'. This fixes the kernel behaviour to also point to '('.

Bug:
Change-Id: I9cd0a2f0cdd4428cd491d02ccc63c72caf285292
Reviewed-on: https://dart-review.googlesource.com/31982
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 07:07:39 +00:00
Leaf Petersen 5aea404159 Hide new core lib MapEntry class where it conflicts in kernel, and
suppress a hint on undefined imported name to make it backwards
compatible.

Bug:
Change-Id: I9c92adcf685248fb8aae9da39c008968768ad29b
Reviewed-on: https://dart-review.googlesource.com/33662
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-10 01:59:48 +00:00
Leaf Petersen 116ecdcf11 Hide new core lib MapEntry class where it conflicts in fasta, and
suppress hints about the undefined name for backwards compatibility.

Bug:
Change-Id: I381af6a8ae5be040e3c149e0cf4b9d45faa8c630
Reviewed-on: https://dart-review.googlesource.com/33663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2018-01-10 01:20:21 +00:00
Mike Fairhurst 4c1cbe1c8f Solve generic function serialization, but not type param scoping.
This is based on https://dart-review.googlesource.com/c/sdk/+/20481/10,
which required a rollback due to numerous secondary revealed issues.

Rather than deserializing function types with the proper scope, and
breaking inherited function type params, ie, `m(x)` where `x`
implicitly gets the type of `x` from `super.m(... x)`, deserialize
generic types incorrectly so that `const x = <Function<T>(T)>[]` fails
but `m(x)` works.

I have work towards fixing this issue, but it is incomplete (#31804),
and had to be rolled back and the fix is only getting more tangled:
https://dart-review.googlesource.com/c/sdk/+/33582.

For now, this will allow people to use Function types *without* type
parameters with no issues, and introduce no secondary issues, and
hopefully be a more straightforward change in and of itself.

-- From Rolled Back CL --

Remove field formal parameter test from other branch


Test genericFunctionType summarization deeper: params, return.

Didn't see a standard way of testing 'void' in the test so far, so I
followed some other tests and used isNotNull, which could be improved.

Fix type arguments vs parameters.

Fix #30858, generic function types not serializable when const.

Previously declaring for instance const lists (or even final lists) of
generic function types ie `final x = <void Function()>[]` would throw
errors during summarization.

The type parameters don't seem correctly stored yet, but that is an
edge case. Left a TODO, for now this should go in to prevent the
analyzer crash.

One thing I changed as well is that `serializeType` assumed it was
getting a type name, and `serializeTypeName` accepted types but threw
when it didn't get a type name. I flipped the names so that
`serializeTypeName` accepts a type name and `serializeType` accepts a
type in general and decides whether its a type name or a generic
function type to proceed with specialization.

Bug:
Change-Id: I98f5a362c9b2e8b3a7e87532ff4645b5963277ab
Reviewed-on: https://dart-review.googlesource.com/33660
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-10 00:16:19 +00:00
Konstantin Shcheglov 527f91a11d Throw FileSystemException from Analyzer's implementation of FileSystem.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I3c7ea1995085380025b0abb7350b20d20ce16d16
Reviewed-on: https://dart-review.googlesource.com/33584
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:30:29 +00:00
Konstantin Shcheglov 4e9e5d0569 Assign analyzer codes to several FrontEnd errors.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I2cf2a948048245e016f0f3d316dcf889c4bde31d
Reviewed-on: https://dart-review.googlesource.com/33583
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:25:48 +00:00
Konstantin Shcheglov 8ed12e00ce Use FrontEndCompiler in ResynthesizeKernelStrongTest.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ia27b1a4cd85c5ae50e22870e895edfa9f03a3cd5
Reviewed-on: https://dart-review.googlesource.com/33560
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:03:39 +00:00
Alexander Thomas 89bd41d19a [infra] Simplify vm-kernel configurations in test matrix
This also adds the missing vm-kernel opt-counter builder.

Bug: https://github.com/dart-lang/sdk/issues/31753
Change-Id: I0199218f83d227cfc52505c213d7b689acd9c43e
Reviewed-on: https://dart-review.googlesource.com/31984
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-01-09 20:59:49 +00:00
Alexander Thomas c637a34a5a [gardening] Mark timing out test as "Slow"
TBR=whesse@google.com

Change-Id: I080c700e6c7e76aad0a70419e21021d92c295f3f
Reviewed-on: https://dart-review.googlesource.com/33464
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-01-09 20:26:58 +00:00
Konstantin Shcheglov a6792904bf Don't append ErrorToken.lexeme, this causes an exception.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I23a590761b07254a37d7dc64b55ff18580a4c767
Reviewed-on: https://dart-review.googlesource.com/33541
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 18:52:39 +00:00
Konstantin Shcheglov d66d08280f Tests for inference of 'void' type for variables.
This must have been already fixed before.
This CL just adds tests to the suite that we use for the top-level issue.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: Ic57c35abd4c31d86e58feeb9fa0c831df94d9ec6
Reviewed-on: https://dart-review.googlesource.com/33520
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 18:13:38 +00:00
Mike Fairhurst 428b2013ee Fix new finding from https://dart-review.googlesource.com/c/sdk/+/20481
new errors since the parameter type inference logic was changed:

analyzing pkg/analyzer...
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:174:16 •
inconsistent_method_inheritance
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:262:16 •
inconsistent_method_inheritance
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:315:16 •
inconsistent_method_inheritance
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:467:16 •
inconsistent_method_inheritance
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:488:16 •
inconsistent_method_inheritance
  error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:501:16 •
inconsistent_method_inheritance
6 errors found.

Bug:
Change-Id: I48b98e287bd6496b0745a1fcb42f87450cbfba9c
Reviewed-on: https://dart-review.googlesource.com/33180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-01-09 16:58:09 +00:00
Konstantin Shcheglov bb52d1afaa Type inference should always infer the return type of operator []= as void.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31779
Change-Id: I1c396cce3f148585218e02ff4e41bc2f85cc924a
     https://github.com/dart-lang/sdk/issues/31638
Reviewed-on: https://dart-review.googlesource.com/32687
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 16:57:59 +00:00
Johnni Winther 966168ba67 Pass type arguments to dynamic calls
This only works for inlining of dynamic methods. Stubs are not created yet.

Change-Id: Ia138117d503b69774984ce9070a3298b87fdbe78
Reviewed-on: https://dart-review.googlesource.com/32766
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-09 13:44:37 +00:00
Jens Johansen f72603ab45 [fasta] Allow --dump-ir to print error program
For instance, with the program snippet from issue #31409 one would not
get any other output than the errors, and one would have to explicitly
dump the dill file afterwards to see what was actually generated.

This CL changes this, so the error-library is also printed (in addition
to the, at least in the case of issue #31409, empty list) as in

```
$ pkg/front_end/tool/fasta compile tmp.dart --dump-ir

tmp.dart:2:4: Error: Expected a function body or '=>'.
Try adding {}.
V();
   ^
tmp.dart:3:5: Error: Duplicated definition of 'V'.
var V;
    ^
tmp.dart: Error: Duplicated name: 'V'.
tmp.dart:2:1: Error: Duplicated name: V
V();
^
library;
import self as self;

static method #main() → dynamic {
  throw "tmp.dart:2:1: Error: Duplicated name: V\nV();\n^";
}
```

Bug:
Change-Id: I8739be43137f098e6dc50df27f4d1d8628bea469
Reviewed-on: https://dart-review.googlesource.com/32602
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-09 13:11:58 +00:00
Jens Johansen 426d94785d [gardening] Mark timing out tests as slow
It seems that f99d3628d1
(CL https://dart-review.googlesource.com/33144)
caused these 5 tests to time out on the pkg builder as well as the try
bots.
Locally the tests take ~40 seconds, so giving it a bit more time (i.e.
marking them as slow) seems likely to turn things green again.

Bug:
Change-Id: I90526b1d7060309d8f1cf902bd9d52c71927f1ed
Reviewed-on: https://dart-review.googlesource.com/33340
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-09 12:57:28 +00:00
Konstantin Shcheglov f99d3628d1 FrontEndCompiler that computes all information about many libraries at once.
Before we used a hack to request resolution information for a single
library as needed, and requested kernels separately. This was hugely
inefficient (but faster to implement as a steel thread). We had then
recompile large library cycles many times, and take just one library.

Before: 480 seconds to compile analyzer (ouch!).
Now: 16 seconds (30 times faster).

Without --previewDart2: 14 seconds.

I will check why it is still slower later.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ic3d47684daa74c53f0336523e17b656f26328acf
Reviewed-on: https://dart-review.googlesource.com/33144
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-09 07:05:54 +00:00
Mike Fairhurst 19920f08e6 Revert "Fix #30858, generic function types not serializable when const."
This reverts commit 60ee2c0dcd.

Reason for revert: Requires https://dart-review.googlesource.com/c/sdk/+/33180 which can land first.

Original change's description:
> Fix #30858, generic function types not serializable when const.
> 
> Previously declaring for instance const lists (or even final lists) of
> generic function types ie `final x = <void Function()>[]` would throw
> errors during summarization.
> 
> The type parameters don't seem correctly stored yet, but that is an
> edge case. Left a TODO, for now this should go in to prevent the
> analyzer crash.
> 
> One thing I changed as well is that `serializeType` assumed it was
> getting a type name, and `serializeTypeName` accepted types but threw
> when it didn't get a type name. I flipped the names so that
> `serializeTypeName` accepts a type name and `serializeType` accepts a
> type in general and decides whether its a type name or a generic
> function type to proceed with specialization.
> 
> Bug: 30858
> Change-Id: Id128f8625cbf03bb94d05ff0efdbac3b158e637e
> Reviewed-on: https://dart-review.googlesource.com/20481
> Reviewed-by: Paul Berry <paulberry@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I6fae28335f7815b1e8c43597fb9451519a13335e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 30858
Reviewed-on: https://dart-review.googlesource.com/33200
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-01-09 00:37:46 +00:00
Konstantin Shcheglov dd8decb695 Fix for explicit 'call' invocation and property get.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I17b11d2cfe53ed69ce251d8a7363f9aaf278e89b
Reviewed-on: https://dart-review.googlesource.com/33145
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 00:18:56 +00:00
Mike Fairhurst 60ee2c0dcd Fix #30858, generic function types not serializable when const.
Previously declaring for instance const lists (or even final lists) of
generic function types ie `final x = <void Function()>[]` would throw
errors during summarization.

The type parameters don't seem correctly stored yet, but that is an
edge case. Left a TODO, for now this should go in to prevent the
analyzer crash.

One thing I changed as well is that `serializeType` assumed it was
getting a type name, and `serializeTypeName` accepted types but threw
when it didn't get a type name. I flipped the names so that
`serializeTypeName` accepts a type name and `serializeType` accepts a
type in general and decides whether its a type name or a generic
function type to proceed with specialization.

Bug: 30858
Change-Id: Id128f8625cbf03bb94d05ff0efdbac3b158e637e
Reviewed-on: https://dart-review.googlesource.com/20481
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-08 23:55:54 +00:00
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Sigmund Cherem 7139df0e38 Add strong sections to language_2 and corelib_2, and change to run dart2js in
strong mode for those two suites

Bug:
Change-Id: I5e7b07c9497afd9f9f65fd0de609d5587d3bd9f1
Reviewed-on: https://dart-review.googlesource.com/33120
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-08 21:08:05 +00:00
Martin Kustermann 0fb2d0bfed Finish the kernel2kernel "constants" transformation by fixing a whole bunch of issues
Change-Id: I24e2ff06db1a7555f5091d0c27060ed79d6787ee
Reviewed-on: https://dart-review.googlesource.com/31980
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-08 19:56:24 +00:00
Brian Wilkerson d68de4e29c Add more recovery tests for partial code
Change-Id: Ic571447fa800e1006ea7576e9e8be856ca0b7f38
Reviewed-on: https://dart-review.googlesource.com/33080
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-08 18:58:14 +00:00
Vijay Menon 49156e823b Address leafp's comments
Bug:
Change-Id: I5dce5b80838a5e17397de44166a0be2b0e583397
Reviewed-on: https://dart-review.googlesource.com/27780
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-08 15:49:02 +00:00
Paul Berry fa8f690071 Implement accessor type override checking rules in front_end.
Test failures introduced by this change have been marked with issue #31616.

Change-Id: Id82a2e850d2d7c3ebcb78b5acb2e59ea3d8da544
Reviewed-on: https://dart-review.googlesource.com/32682
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-08 14:46:42 +00:00
Johnni Winther ab636dfbd1 Reenable warnings/hints for method type variables in dart2js
Change-Id: I09662afc8b1a4e8c9fdbfe2e342e80ea58351593
Reviewed-on: https://dart-review.googlesource.com/32060
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-01-08 12:48:02 +00:00
Johnni Winther 8e8915f538 Support generic closures in rti analysis
Change-Id: I1d393cff5b83f8db69e7bddb8ecfcd4a5205854f
Reviewed-on: https://dart-review.googlesource.com/32700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 11:36:40 +00:00
Aske Simon Christensen 0c03458717 Reland "Treat most warnings as errors in strong mode."
Reland of https://dart-review.googlesource.com/c/sdk/+/29160

Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

Closes https://github.com/dart-lang/sdk/issues/31286

Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b
Reviewed-on: https://dart-review.googlesource.com/32580
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-08 09:20:02 +00:00
Dmitry Stefantsov d9f7f81961 Add tests of instantiate to bound in fasta
Change-Id: Ie4940c9fda24abcfd038409e993f208a6ba0a94a
Reviewed-on: https://dart-review.googlesource.com/31940
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-01-08 08:35:22 +00:00
Konstantin Shcheglov e839405b0f Improve compound assignment inference.
Fixes #31484

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: I94a571978a4052adca4c85df06941ccf56998bac
Reviewed-on: https://dart-review.googlesource.com/32863
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-08 05:54:53 +00:00
Konstantin Shcheglov 7784ba0056 Correctly infer List<Null> and Map<Null, null> types when outside a method body.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ib9c1e86c9514a9e3d2a57400cea394dd25e2e25b
Reviewed-on: https://dart-review.googlesource.com/32802
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-08 04:18:22 +00:00
Konstantin Shcheglov 27de84923b Use “bool” as the downward inference context for assert conditions, while/do cycles, if/for conditions, and logical operators.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: I869d958515eb29994e570aac8343b90878d30e98
Reviewed-on: https://dart-review.googlesource.com/32880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-08 03:56:32 +00:00
Konstantin Shcheglov 9c05a32fe7 Use the type of the switch expression as the context for case expressions.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I7a2615f9448dbdd3d22a52fc45312b87e52cd76e
Reviewed-on: https://dart-review.googlesource.com/32881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-08 03:36:13 +00:00
Paul Berry eeb903499d Test more for-each downward inference corner cases.
Note that the annotation "/*@target=C::aField*/" is duplicated in the
test due to #31790.

Change-Id: Ie3cf2dea7efb9ae46310ee069a588feb37855201
Reviewed-on: https://dart-review.googlesource.com/32862
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-08 02:52:33 +00:00
Devon Carew 9229151b03 Remove two uses of visibleForTesting.
Bug:
Change-Id: I2952b7acce54e7d3c1fe2c829c0091e9ba031314
Reviewed-on: https://dart-review.googlesource.com/32686
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-01-07 23:33:31 +00:00
Konstantin Shcheglov a8ebc3115c Use the same rule for inference in expression function bodies as in block bodies.
Bug: https://github.com/dart-lang/sdk/issues/31436
Change-Id: I535c39383d42862f035b54e2fb5c143367605697
     https://github.com/dart-lang/sdk/issues/31638
Reviewed-on: https://dart-review.googlesource.com/32860
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-07 20:46:31 +00:00
Konstantin Shcheglov bbd835f322 Improve for-in statement inference.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: Ie15486387a6b5955e42e9fe5fc00cdba4f2ba68a
     https://github.com/dart-lang/sdk/issues/31440
Reviewed-on: https://dart-review.googlesource.com/32861
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-07 18:57:11 +00:00
Paul Berry 105b170ddb Roll package test to 0.12.29+1 and stack_trace to 1.9.0
This required some changes to analysis_server, since analysis_server
used to have its own version of pumpEventQueue().  Since
pumpEventQueue() is now provided by the test package, I've removed
analysis_server's version, and I've updated some of the call sites to
pass in "times: 5000" to replicate the old analysis_server behavior.

This also required some changes to analyzer, since the fail() method
is now marked as @alwaysThrows, so no code may follow it without
producing a dead code hint.

Change-Id: Ie5ef3a5cc685c18da02de699e59f63f3bb8865f7
Reviewed-on: https://dart-review.googlesource.com/32683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-07 14:22:23 +00:00
Dan Rubel cdd4268bc8 Revert "Improve fasta field recovery"
This reverts commit ab229b30ef.

Reason for revert: Failing co19 test

Original change's description:
> Improve fasta field recovery
> 
> In addition to improving field recovery, this CL
> fixes class field recovery to include an endMember event event
> and cleans up missing class body recovery.
> 
> Change-Id: I53afe5aef55452108803388de9245f7e14f97833
> Reviewed-on: https://dart-review.googlesource.com/32820
> Commit-Queue: Dan Rubel <danrubel@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Id2976bfe67b410875a912bbfd6bfcbbe3d3c8c75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32840
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-07 02:06:32 +00:00
Dan Rubel ab229b30ef Improve fasta field recovery
In addition to improving field recovery, this CL
fixes class field recovery to include an endMember event event
and cleans up missing class body recovery.

Change-Id: I53afe5aef55452108803388de9245f7e14f97833
Reviewed-on: https://dart-review.googlesource.com/32820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-06 21:51:50 +00:00
Konstantin Shcheglov 32e310d8c6 Infer closure parameter types as Object instead of Null.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31638
Change-Id: If739da50a1d7e21c6a1e18da18d1f85f788663da
     https://github.com/dart-lang/sdk/issues/31546
Reviewed-on: https://dart-review.googlesource.com/32669
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-06 02:31:19 +00:00
Brian Wilkerson 72200eee24 Fix expressions in asserts to be bool rather than a closure
Change-Id: I2fbb495b51ba4ff34b3893075b86153d294607b8
Reviewed-on: https://dart-review.googlesource.com/32684
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-06 01:54:18 +00:00
Emily Fortuna cea3419584 Removed unnecessary Location parameter in closure conversion.
Bug:
Change-Id: I4460e8b54e104de1c8643f62f35176a2af537a6d
Reviewed-on: https://dart-review.googlesource.com/32722
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2018-01-06 00:34:08 +00:00
Konstantin Shcheglov b275d523b4 Fix summarizing for 64 bit limits.
R=brianwilkerson@google.com

Bug:
Change-Id: I7116f6b3ffc15de5c02db96d993d9c3028359043
Reviewed-on: https://dart-review.googlesource.com/32660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-06 00:30:00 +00:00
Sam Rawlins 43a86d4a60 Fix a few @visibleForTesting enforcement bugs.
Fixes #31742, #31786, #31787

Bug: https://github.com/dart-lang/sdk/issues/31786
Change-Id: Iaa9ee2708ee9e89f1dd84a0223114f1415ef8261
Reviewed-on: https://dart-review.googlesource.com/32666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-01-05 23:44:08 +00:00
Sigmund Cherem 497d592ac7 Fixes for deferred constants in the kernel pipeline.
The constant collector was inconsistent with the old frontend: we were
skipping primitives and we were not going into the body of closures.

Change-Id: I3321426da7e684d203f0ac7a2a2c7028f3138a7b
Reviewed-on: https://dart-review.googlesource.com/32663
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-05 23:37:58 +00:00
Alan Knight dcf0a44713 Add an [[instance members]] section when formatting Maps. Also sorts fields ahead of getters in ObjectFormatter
Bug:
Change-Id: I8af2c497b3fef5808a59d19e0c3aab09084fef42
Reviewed-on: https://dart-review.googlesource.com/32503
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2018-01-05 23:08:29 +00:00
Jenny Messerly 0add93f98e fix #31781, fromEnvironment constants in DDK
Change-Id: I5915677204c0b02321e8db6a34e870b6ac63179d
Reviewed-on: https://dart-review.googlesource.com/32681
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-05 22:55:18 +00:00
Stephen Adams 31cd4e1457 Factor deferred loading data
'Normalize' the data used for loading deferred libraries.  Replace
URIs and SHA1 hashes with indexes so that the URIs and hashes occur
once.

Bug: https://github.com/dart-lang/sdk/issues/29635
Change-Id: I3ac8791ad44ca588cbb1bd7d86f18243c956a04a
Reviewed-on: https://dart-review.googlesource.com/32505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 22:02:49 +00:00
Harry Terkelsen b8b69b1bd9 dart2js-kernel: fix switch with always-throwing method call
Change-Id: I8884207f05ba8cf0a2841f21b1a0e8189ebe14d4
Reviewed-on: https://dart-review.googlesource.com/32662
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-05 21:48:28 +00:00
Jenny Messerly 303d71f53f fixes #31575, DDC kernel backend can now compile the SDK to JS
Also adds this to the build script, so we can eventually replace the existing SDK compile step with this new one.

Change-Id: Iba0720df5bbab302d2fdd0b5aeeb182de152cc98
Reviewed-on: https://dart-review.googlesource.com/32504
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-05 21:32:50 +00:00
Mike Fairhurst e34aae20ce Fix \#31680 function types in type parameter bounds
Bug: 31680
Change-Id: Ib031bb89c3ca1dc3ce96ca10b4d98cf46d7b705b
Reviewed-on: https://dart-review.googlesource.com/32661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-01-05 20:47:09 +00:00
Dan Rubel 4429c91968 Add fasta parser prefixed type recovery
Change-Id: I4985ac2d3c9653521fe6552db54f49d7ed22f84a
Reviewed-on: https://dart-review.googlesource.com/32720
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-05 20:36:19 +00:00
Konstantin Shcheglov 560fb2998d Don't add empty leading/trailing strings in multiline strings.
Bug:
Change-Id: Ia556ecb8bbffe94808de34340d60cfff74464476
Reviewed-on: https://dart-review.googlesource.com/32520
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-05 17:01:49 +00:00