Commit graph

68059 commits

Author SHA1 Message Date
Alexander Thomas 64b0bfac68 [infra] Update CHANGELOG.md for 2.6.1
Change-Id: I0a508941b160af012833c12d1c4febfb6e2c176a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124690
Reviewed-by: Michael Thomsen <mit@google.com>
2019-11-11 11:52:13 +00:00
Johnni Winther 4a661e19e2 [cfe] Remove type_promotion_look_ahead_listener.dart
This experiment isn't used.

Change-Id: I8a45283182e361f6fc69f586346e01913b83560a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124686
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-11 11:51:57 +00:00
Jens Johansen 12c92332f8 [CFE] Parser test can run scanner in non-nnbd-mode
Tests in the folder "non-nnbd" are run in non-nnbd mode.

Change-Id: I27c2acec93f729b76f024f12dcfb84f31903e0b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124688
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-11 11:43:07 +00:00
Karl Klose 684c456ffc [cfe] Remove reify runtime
Change-Id: I7f8ad03326cbdbf1e75bc3ced024f8b467f5892c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124687
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-11-11 11:15:57 +00:00
Aske Simon Christensen e8de03915b [vm] Remove obsolete kernel constant expression evaluator.
Change-Id: I16c515135468e526263db180f7252e7fdebe6414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111643
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-11 10:32:24 +00:00
Sigurd Meldgaard 0e9eadcb71 Upgrade pub revision
$ git log --pretty=oneline 80ac76400ff58fde3c5a335d860d196c3febe837..HEAD
d15067931a6b671a1c9dcc98b5923347676269cf Add link to Flutter plugin docs to warning message (#2253)
61601357ac5857ddf7507ef71678cb9d15344f26 Improve error message when .dart_tool/package_config.json is missing (#2252)

Change-Id: I01726a0dd3d1c96301425d97294c7251ed4681fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124685
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2019-11-11 10:04:12 +00:00
Jens Johansen 48f0b83ff2 [CFE] Allow ! in cascade
Fixes #39286.

Change-Id: I4e7270dacf7bc43accae4d45d26146cfb7d2b1ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124330
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-11 09:44:12 +00:00
Jens Johansen cf2a474438 [CFE] Fix incremental serialization bug caused by missing parameter passing
When implemention the incremental serializer, I forgot to pass it on in
the incremental kernel generators "IncrementalKernelGenerator.fromComponent"
and only did it in "IncrementalKernelGenerator", meaning that when using
"IncrementalKernelGenerator.fromComponent" the incremental serializer wasn't
used properly, namely nothing got invalidated.
Now it gets passed correctly, things get invalidated and everything should
be fine.

Fixes https://github.com/flutter/flutter/issues/44384.

Change-Id: Ic2e7f7330dc6ee62dd8e7bf6684d7bee8ee328bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124684
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-11 09:40:42 +00:00
Johnni Winther a7a54afbaa [cfe] Support failure log printing in unit_test_suites
Change-Id: Ibc0d81aaabcf2913ba97f242bbdc2d7968b1a5ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124682
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-11 08:31:52 +00:00
Wink Saville bbdb7860f6 [build]: Build on Arch Linux with python 2.7-3.8
This change allow builds to succeed on Arch Linux with python 2.7, 3.7.4
and 3.8. Otherwise it fails with python 3.7.4 and 3.8.

- bin_to_assembly.py

  Using ord(byte) here is an error on python 3.x use a conditional
  expression instead.

- create_archive.py

  Using ord(byte) here is an error on python 3.x use a conditional
  expression instead.

  Use `as inst` syntax which is required by 3.x

- create_string_literal.py
- gen_library_src_paths.py

  Use `as inst` syntax which is required by 3.x

- make_version.py

  print >> sys.stderr syntax is not supported by 3.x use file=sys.stderr
  and add `from __future__ import print_function`

  vmhash.update requires a string use encode('utf-8')

  versopm+cc+text.replace requires a str so use `decode`.

Test: No added tests as there are no behavioral changes.
Change-Id: Id9b0a3187d06ad2b2dce3cf2244144393caddc9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124211
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-11-10 21:09:58 +00:00
Stephen Adams 64e65a7dab [dart2js] new-rti: Use local in setting up type$
Saves 0.05% on CM. Should be slightly faster too - fewer tokens to
parse.

Change-Id: I9ce674525817e215e868a616729a465a60b8ef20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124468
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-11-09 02:11:28 +00:00
Mayank Patke 8f1be54906 [dart2js] New RTI: Improve normalization of is-tests.
Change-Id: I48e5a19af931dd2f76cceea6b5a9abb513d5fd39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124463
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-11-09 02:06:09 +00:00
Fizaa Luthra 1b344fc77e [dartfuzz] Add fuzzer support for extension methods for classes
Change-Id: I3843990921d93727e17dd2593177bdf7af740571
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123340
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Fizaa Luthra <fizaaluthra@google.com>
2019-11-09 01:26:59 +00:00
Robert Nystrom ed956daa3f Update the DDC dart:async patch file version to match the migrated lib.
Change-Id: Ia15e68e2124fe0af5ebcb36529cef943b3406362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124642
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-09 00:57:18 +00:00
Devon Carew be2866b9b1 [analyzer] update lib/crash_reporting.dart
Change-Id: Ie3b3ffc8a0e0351341f28ff26bbb3c82deb0b5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124640
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-11-08 23:29:58 +00:00
Leaf Petersen 8ca18f1a14 Extension method prefixed import tests.
Adds tests for the change to make extension members accessible even
for prefixed imports.  Also tests that it is an error to import a
library with extensions as deferred without hiding the extensions.

Change-Id: I3a81c560694d34c8adbb4cc86ca9e6b8a129ae56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124589
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-11-08 23:17:08 +00:00
Nicholas Shahan 750a83b896 [dartdevc] Fix crash when source files contain non-UTF8 characters
* Treat the assertion condition offset as a character offset in the file.
* Allow unrecognized characters to be replaced by a placeholder character. This
  is unrelated to the fix but is just a precautionary measure.

Fixed: 39271
Change-Id: I4871ea41d3a46d26ecac5047265a1dbc1c889350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-08 23:10:59 +00:00
Régis Crelier d45c3d15cb [VM/nnbd] Make Nullability and NNBDMode class enums to avoid name conflicts.
Change-Id: Ic78d3f48964bb61cbd1d90a69fcd68b4f29071e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124587
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-08 21:32:48 +00:00
Janice Collins cfec969eff Update dartdoc version to 0.29.1.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v0.29.1

Change-Id: I2ad924de906d171c6d17ba05f80eed815d8cd97f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124590
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2019-11-08 21:28:57 +00:00
Brian Wilkerson e3e0ef8548 Make explanations for unchanged types optional and disabled by default
Change-Id: I653f5ed1807cef7b444e014d8629bc8ef772f6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124588
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-08 20:20:48 +00:00
Brian Wilkerson e39b0f8d99 Disallow a deferred import of a library with extensions if any extensions are visible
Change-Id: I37f08e56cfbbdd5147abd28ae40f2358cd7d1382
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124584
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-08 19:55:47 +00:00
Johnni Winther 9c983d2ee3 [cfe] Support extensions via prefix
Change-Id: I6c1e69e5a5c83f5177754a350f5efbca9384972b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124540
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-08 19:53:00 +00:00
Konstantin Shcheglov 5f5ce5d119 Include type parameter bounds into string expections for subtyping.
R=brianwilkerson@google.com

Change-Id: Id2ef295a1eb77221199ed2f098961990b249e8b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 19:47:38 +00:00
Konstantin Shcheglov dc69edcdb3 NullabilityEliminator for removing nullabilities in legacy libraries.
Change-Id: I3202ef39954e27b26a5851f449903fa1fac1eb63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 19:10:09 +00:00
Brian Wilkerson 7ad7e6202d Allow extensions imported with a prefix to be accessible
Change-Id: Iccc4a0c1ad50e13f5034fb1214d549a29e8a3e7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-08 18:52:48 +00:00
Régis Crelier ea57b1e62c [VM/nnbd] Pass nullability when creating Class::DeclarationType.
Passing nullability rather than forcing kLegacy helps slightly reduce the number
of Types in the VM and in snapshots.
This allows to remove the kludge about declaration type of Null being kNullable.
Also pass nullability when creating a simple type may help.

Note that CFE is still producing super types and some interface types that are
non-nullable, even with nnbd features disabled. But this should get fixed and
further reduce the number of types in the snapshot.

Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-08 18:40:59 +00:00
Alexander Markov fa43799461 [vm/bytecode] Check number of type arguments in non-generic closures
Fixes https://github.com/dart-lang/sdk/issues/39283

Change-Id: I5a5fdf158c6a7ce068be36754ea0487cb754584b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124470
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-08 17:16:37 +00:00
Konstantin Shcheglov a01c3b464e Use TypeParameterElement(s) as free variables in FunctionType.toString().
Types should have never been used here in the first place.
And with nullability we get mismatches where type parameters are used
with a suffix :-(

Change-Id: I93ff61ee9bf32c24cdf3d2aadeb23cbb84b34cfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-08 17:07:13 +00:00
Alexander Aprelev 9c4c49d9ee [vm/benchmarks] Reduce number of isolate spawn runs from 5 to 3.
This is to reduce load on Android benchmarking hardware.

Change-Id: Ib51b3fbbe2bf66cb0ba17375062a747f37284299
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124600
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-11-08 17:04:07 +00:00
Konstantin Shcheglov e3aac9e25d Check more in LegacyTypeAsserter.
Change-Id: Ie90ff509dd4327ef33a1ce7fb81657ff8c2f1412
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 17:00:07 +00:00
Janice Collins 0957c13054 Check for null before dereferencing constraint text.
Bug: https://github.com/dart-lang/sdk/issues/38839
Change-Id: I63104ec32d871a61f7e5f65e605ea01faf0d2aaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
2019-11-08 16:41:08 +00:00
Johnni Winther fd9f79c25d [cfe] Handle deferred explicit extension access
Change-Id: I53e13ac3b4f1bdcd26ccec86814fb4d708c5cceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124542
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-08 14:19:47 +00:00
Paul Berry 7c78ab75a5 Migration: allow already-migrated libraries to be opted in.
A core assumption of the migration tool is that the code being
migrated may have some dependencies that have already been migrated
(e.g. the SDK itself).  Of course these dependencies will need to be
analyzed as "opted in" libraries so that they can have nullability
annotations.

However, when the migration tool was first being developed, we didn't
yet have a migrated SDK, so the SDK was opted out and we just had to
pretend that it was opted in.

This CL prepares to switch over to a truly opted-in SDK by updating
the AlreadyMigratedCodeDecorator to handle opted-in code.

Change-Id: I797752401f8c7bf7cdf8d26d03d00d3d213a5127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-08 13:53:17 +00:00
Paul Berry 6317779f9b Simplify TestTypeProvider constructor.
The only optional parameter that was actually used was
nullabilitySuffix, so eliminate the others, and make it a named
parameter for easier future expansion.

Change-Id: Iee05e955a1c996b4e1dd9bbec3db7fd1588ebe04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 13:53:17 +00:00
Paul Berry 7e8e66016a Migration: do not use always or never in already-migrated types.
Previously, when the code being migrated referred to a nullable or a
non-nullable type in an already-migrated library, we would use the
`always` or `never` graph node to represent the nullability of the
type.  This was problematic, because it made it difficult for
instrumentation to pinpoint precisely which element in an
already-migrated library was the cause of an expresion being
null-checked, or a type being made non-nullable.

We now create a fresh nullability node for each non-nullable type
coming from already-migrated code, with an edge to `always` or `never`
to ensure that the fresh node has the correct nullability, so that
instrumentation can see precisely which element it came from.

Since the migration tool doesn't traverse the ASTs of already-migrated
code, we can't report an AST node that caused such an edge, so an
`element` getter has been added EdgeOriginInfo to allow us to report
the element that caused the edge.

As before, types associated with already-migrated code are reported to
instrumentation via InstrumentationListener.externalDecoratedType.  As
a new enhancement, bounds of generic parameters in already-migrated
code are reported to instrumentation via
InstrumentationListener.externalDecoratedTypeParameterBound.

Change-Id: Ided4e96e2920f8d9062688f5a6fda29b9b71dd12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-11-08 13:53:17 +00:00
Dmitry Stefantsov e4a60912a7 [cfe] Use library's NNBD opt-in status while serializing supertypes
Change-Id: Id1ab5fd9a36b4aadb213febb0e1ae2eba968244d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124331
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-11-08 10:24:36 +00:00
Jens Johansen ee2efe8e58 [CFE] Add more incremental compiler tests, prepare for better invalidation strategy
Change-Id: I94a61b1fa9bab466a7fc09d873fc75dea6b3aeb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124324
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-08 09:55:26 +00:00
Jens Johansen 5eaccc20ba [CFE] Incremental test suite now has expect files
Change-Id: I704b87d56686cb282898511fb95d6b47ee9a1c9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124323
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-08 09:47:36 +00:00
Karl Klose ec0d042955 [infra] Support multiple named configurations in test infrastructure
This change allows to run test.dart and pkg/test_runner with multiple arguments
for the -n option to run tests for multiple configurations with one invocation.

Change-Id: If62e0bfc364460fa415c7f700f7e449b0de56987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122395
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-11-08 08:06:36 +00:00
Stephen Adams b334ea8320 [dart2js] new-rti: experiment - fault in '$is' test
Change-Id: Ie6d17e3439fb67fe79e9dec4dc7cb5437d1f6915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121766
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-11-08 06:00:06 +00:00
Konstantin Shcheglov 7a45228584 Use ElementsTypesMixin in TypeSystem tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If7195af4f5e90e6acce60912f1c66c5cf956865c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-08 04:00:06 +00:00
Alexander Markov ec519c3d16 [vm/aot] Disable bytecode in AOT compilation pipeline
This is needed for the next D27 release.

Change-Id: I199ac701cb140dc84bb723d232c1b408088b1fe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124469
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-11-08 03:18:36 +00:00
Liam Appelbe f4780a6450 [vm] Late modifier for non-static final fields.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ib2b3189b20bd056b6378fa5d7a6166acef9a5c67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124465
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-07 23:50:57 +00:00
Ryan Macnak 23770fcc6c [vm, gc] Increase HeapPage size to 512k; increase max heap size to 32GB.
Change-Id: I0d5649d37a73caea39d3f703f429a4af7b4c29c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113950
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-07 22:45:47 +00:00
Mike Fairhurst e68ca9b652 [analyzer] move crash reporting to server because telemetry isn't pulished
Change-Id: I8fb293632267e7991c578076a43bfbd277fc1ee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-11-07 22:19:07 +00:00
Paul Berry 395373a90c Further improvement to ID testing error output.
We now print the error code as well as the message, which makes it
easier to locate the analyzer code related to the error.

Change-Id: I9e18744ce8e58efe6a5ecb7e7a98035777982836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-07 22:06:17 +00:00
Paul Berry cdde5418e1 Rework null-shorting logic to improve robustness, add public API.
The proper behavior of null-shorting relies on proper pairing between
FlowAnalysis.nullAwareAccess_rightBegin (called upon reaching a `?.`
during resolution) and FlowAnalysis.nullAwareAccess_end (called upon
reaching the termiation of null-shorting during resolution).
Previously, we ensured that invariant by the following mechanism: when
visiting an expression that might terminate null-shorting, we would
walk backward through the expression to try to figure out how many
outstanding `?.`s it contains, and call
FlowAnalysis.nullAwareAccess_end an appropriate number of times.  This
was fragile because we had to guarantee that the backward walk would
find exactly the correct set of `?.`s for which null-shorting was
open.

With this change, we ensure proper pairing between
FlowAnalysis.nullAwareAccess_rightBegin and
FlowAnalysis.nullAwareAccess_end by keeping a stack of the expressions
that should terminate null-shorting once we finish visiting them.

Additionally, we add an accessor to the API called
`nullShortingTermination`, allowing a client to ask when the null
shorting introduced by a `?.` will terminate.

Change-Id: I8ec99e6bad7605d50ef3a6bc6c11634ece5043a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-07 22:06:17 +00:00
Mayank Patke 9cf7d7f1f4 [dart2js] New RTI: Improve handling of top types during is-test
specialization.

This change also adds plumbing so that we can access the kernel logic
for instantiation-to-bounds. This allows us to emit the `instanceof`
is-test specialization when all type arguments are at bounds.

Change-Id: I73cdcaeb1984d31761ddb9a5765e5bd0f29d06ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124206
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-11-07 21:57:17 +00:00
Konstantin Shcheglov 1ab6ba98d3 Test GLB and LUB symmetry for FunctionType(s).
https://github.com/dart-lang/sdk/issues/26126 was fixed,
so we can do this properly now.

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

Change-Id: I938df344a96470f461f8d7f4cf530bc0b290453c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-07 21:51:17 +00:00
Konstantin Shcheglov cb0e5c5a3e Set operator== parameter type to dynamic if directly from Object.
See https://github.com/dart-lang/language/issues/569

See https://github.com/dart-lang/sdk/issues/38339

Change-Id: I8d42135985aa4d55ffcc65cdf849572736cb9198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124284
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-07 20:07:29 +00:00