Commit Graph

34735 Commits

Author SHA1 Message Date
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Konstantin Shcheglov b7d61493aa Prepare to publish analyzer_plugin 0.5.0
Change-Id: I43e8ebb63cbdff4f0b29d4abf1c599f7e1dd791f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:13:27 +00:00
Joshua Litt 70db4908e4 Revert "[dart2js] Avoid reserializing the closed world alongside type inference."
This reverts commit 7b022a7f2f.

Reason for revert: Missed one of the references to write-data

Original change's description:
> [dart2js] Avoid reserializing the closed world alongside type inference.
>
> This cl adds a temporary flag '--no-closed-world-in-data' in order to
> support serializing global inference results with and without the closed
> world.
>
> This flag only exists to allow us to roll this into google3. Afterwards,
> it will be removed.
>
> Change-Id: I6e9712739edd148edcf43007b6ece35efa688538
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192124
> Commit-Queue: Joshua Litt <joshualitt@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sigmund@google.com,joshualitt@google.com

Change-Id: Icc8082462f02bc7336953c915ef2203697085358
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193584
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-03-30 22:29:03 +00:00
Brian Wilkerson e4bb500c7b Add a json format to dartanalyzer
Change-Id: I3a23607f29de6c6feeed468b2bcf065dbb9044d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193526
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-30 22:10:12 +00:00
Konstantin Shcheglov 8c4d10d9cf Tests for IMPLEMENTS_SUPER_CLASS and MIXINS_SUPER_CLASS via type alias.
Also a small tweak for reporting repeated implements/with.

Bug: https://github.com/dart-lang/sdk/issues/45489
Bug: https://github.com/dart-lang/sdk/issues/45526
Change-Id: I6b3e7cb545ce5c63b8facd8b2e55593a45196779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 21:42:31 +00:00
Paul Berry 72ffbaa7d7 Rework _fe_analyzer_shared mini-AST to use an L-value abstraction.
Rather than representing an assignment differently depending on what
kind of construct appears on its left hand side (as kernel does), we
represent all assignments as a single `_Write` type, and use an
`LValue` base class to represent the different kinds of constructs
that can appear on the left hand side.  This representation will be
easier to expand into supporting more of the Dart language as we
expand the testing we want to be able to do in _fe_analyzer_shared.

Change-Id: I87b811176b2ba132fb992414c277cf2c6b81e03c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-30 21:07:01 +00:00
Mayank Patke 66f36512c5 [dart2js] Avoid repeating RTI type redirections across output units.
Change-Id: I71746528b44dc2afab7b85ecc807491d12cb51a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191985
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-03-30 21:05:51 +00:00
Devon Carew 26061ae61e Fix an iterable_contains_unrelated_type warning.
Change-Id: Ie9b5ff4298b1213ccec8764728a9a40475e56603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193340
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-03-30 20:37:11 +00:00
Robert Nystrom 2a966bcf6b Fix old bug in the test runner's test server.
I apparently broke this four years ago (in
https://codereview.chromium.org/2919573003) and never realized. Caught
it today because of a lint warning.

Change-Id: I00d71ccde581e685620800b603b0ffb9e8e3a1b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192951
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-03-30 18:49:31 +00:00
Robert Nystrom fdb6ca6d01 Add support for context messages to static error tests.
Currently only CFE ("Fasta") tests have their context message output
parsed. It should be easy to extend that to dart2js and DDC if that's
useful. Analyzer might be more work.

This also adds support to the test updater for inserting context
messages when updating tests. By default, that flag is off, so the
existing behavior is preserved where context messages are ignnored. If
you want them, pass "-c" when updating a test.

When validating test output, if the test file contains context messages,
then they are validated. Otherwise, any context messages in the CFE
output are ignored. This way existing tests still pass.


Change StaticError to represent a single error for a single front end.

Before, the data model collapsed errors for different front-ends at the
same location into a single StaticError object which tracked different
messages for each front end. The idea was to move towards a world where
they really are the "same" error with eventually the same message.

But this adds a lot of complexity with things like merging errors and
doesn't reflect the reality that each error from each front end is
basically its own thing. Also, critically, it makes it much harder to
attach context messages to a specific front end's error object.

This changes it so that an instance of StaticError represents a single
error for a single front end. The test file syntax is unchanged and the
updated tool behaves the same. In a static error test, multiple
expectations can still share the same "//   ^^^" marker line. They are
just expanded to multiple StaticError objects at parse time.

This eliminates all of the complexity around merging and simplifying
errors.

Change-Id: Ida1736bfcde436fc2d1ce2963d91fa9cb154afa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193281
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-03-30 18:41:21 +00:00
Paul Berry 6c30a7d582 Flow analysis: implement "why not promoted" logic for index expressions.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I52a0fa33dbeb4f6382dd8b3154ead25ca2065878
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193088
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-30 18:24:11 +00:00
Paul Berry 20acfbc876 Move checkIndexExpressionIndex checking to resolver.
In order to implement "why not promoted" functionality index
expressions, we need to call checkIndexExpressionIndex from the
resolver, so that we can pass it failed promotion information.  So
move it into the ErrorDetectionHelpers mixin.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Idc70e3421142da1d3100c288c912b6483a91b28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 18:24:11 +00:00
Joshua Litt 4bd278742b [dart2js] Remove omitted output units from deferred_loading_test.
Change-Id: I69f728129b865cae3ec46426af2890127378e44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193090
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-03-30 18:17:23 +00:00
Joshua Litt 7b022a7f2f [dart2js] Avoid reserializing the closed world alongside type inference.
This cl adds a temporary flag '--no-closed-world-in-data' in order to
support serializing global inference results with and without the closed
world.

This flag only exists to allow us to roll this into google3. Afterwards,
it will be removed.

Change-Id: I6e9712739edd148edcf43007b6ece35efa688538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192124
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-30 16:59:41 +00:00
Robert Nystrom 5cc772b8aa Optimize static error test file parsing.
For some reason, the regexp to strip off multitest comments was very
slow. On a couple of co_19 tests with pathologically long lines, it
would hang practically forever. Even on shorter lines, it was noticeably
slow. This fixes that.

Change-Id: I04f2894f474dcc593e982dd691945421396274a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193222
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-03-30 16:58:11 +00:00
Konstantin Shcheglov fa243e700a Issue 45492. Report TYPE_ARGUMENT_NOT_MATCHING_BOUNDS for not regular bounded type as a type alias body.
Bug: https://github.com/dart-lang/sdk/issues/45492
Change-Id: I303a7066c356e645d549960f66c1d7b8d50f307a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193452
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:11 +00:00
Konstantin Shcheglov fcb9bfb81b Report IMPLEMENTS_REPEATED and ON_REPEATED also when via type alias.
Change-Id: Ied864fe708b6f00976e0629f8f3e514b693b5129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193451
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:02 +00:00
Robert Nystrom 073eb9b806 Change StaticError to represent a single error for a single front end.
Before, the data model collapsed errors for different front-ends at the
same location into a single StaticError object which tracked different
messages for each front end. The idea was to move towards a world where
they really are the "same" error with eventually the same message.

But this adds a lot of complexity with things like merging errors and
doesn't reflect the reality that each error from each front end is
basically its own thing. Also, critically, it makes it much harder to
attach context messages to a specific front end's error object.

This changes it so that an instance of StaticError represents a single
error for a single front end. The test file syntax is unchanged and the
updated tool behaves the same. In a static error test, multiple
expectations can still share the same "//   ^^^" marker line. They are
just expanded to multiple StaticError objects at parse time.

This eliminates all of the complexity around merging and simplifying
errors.

Change-Id: I1d55a6e885e12cc9c438f928297fc0db7dd5ce85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193280
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-03-30 16:30:21 +00:00
Johnni Winther 0a1a5276ba [cfe] Ensure that types are also resolved in case of parser recovery
Closes #45490

Change-Id: I447a637a13fc9a32528a79f0f036c0aa6f74abb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193407
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-30 14:56:38 +00:00
Dmitry Stefantsov 3a21e08d9e Reland [cfe] Remember built TypedefTypes for late bounds checks
Closes #45487.

Bug: https://github.com/dart-lang/sdk/issues/45487
Change-Id: Idf68c051260b47e9d830c5de0cba977e2f85b427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193401
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-30 13:49:18 +00:00
Johnni Winther 13556d623f [cfe] Add DartType.toNonNull
Add helper on DartType to compute the `NonNull` of a type and use this
instead of `withDeclaredNullability(Nullability.nonNullable).

Includes a fix in the computation of NonNull of FutureOr.

TEST=existing

Change-Id: I3399cbf89c7d3f3e90f1315b01f40957e798a1b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-30 10:25:28 +00:00
Johnni Winther 57f18c6d38 [cfe] Add tests for issue 45376
These tests show that we handle >> and >>> similarly wrt to allowing
integer operations on double constants with integer values.

https://github.com/dart-lang/sdk/issues/45438 proposes to disallow these,
but that requires a new js evaluation strategy and the issue in 45376
is therefore just a consequence of the current approach.

Change-Id: I703b57d5a6562ff1c1410858b22a96655f59dc4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193406
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-30 10:25:08 +00:00
Brian Wilkerson 8c775581e2 Fix a bug in data-driven fixes handling of parameter changes
Change-Id: Ic5872a364bfcadc302ec35c0cf63ec87e5e2594b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193444
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-30 04:15:38 +00:00
Kallen Tu 5b3a5acf01 [cfe] Switch statements for const functions.
Change-Id: I1194f9091b74ba3e288d5e7bd386c204fa25c837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193360
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-30 03:56:58 +00:00
Konstantin Shcheglov 114d7b980a Migrate analyzer_plugin package to null safety
Bug: https://github.com/dart-lang/sdk/issues/45236
Change-Id: I01175a2b2b1eb3ce6cdf30ade794d8186c6e8ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 00:29:37 +00:00
Daco Harkes 4ba4fd3f1d [analyzer/ffi] Inline array annotation const dimensions
Moves the Array forwarding constructors and _ArraySize class out of
the patch files so that the analyzer can reason about them.
(The analyzer does not include patch files, because it does not know
whether it's analyzing for VM or JS backend.)

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

Change-Id: Ia0eb4bbca40b906a1e636714f53c5c73dcfc3cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-30 00:28:57 +00:00
Robert Nystrom 02a0396f74 Don't crash on --help, --find-configurations, or --list-configurations.
Change-Id: Ib774469489d9acfae7aa35fc75f00189b25a8161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192952
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-03-30 00:20:54 +00:00
Daco Harkes 93a187e6c8 [analyzer/ffi] Error on sizeOf<Handle>()
Test covers both analyzer and CFE throwing an error. (But does not
test what error.)

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

Change-Id: I8b820347945d88304d3f03d7d03f156b7111db42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193405
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-30 00:20:52 +00:00
Daco Harkes 86635c76fa [analyzer/ffi] Fix NPE in ffi_verifier
Closes: https://github.com/dart-lang/sdk/issues/45498

Change-Id: I836c52b03800bc8282e5f26168f1feab93068b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193304
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-29 15:56:18 +00:00
Dmitry Stefantsov 9008fc0eaf Revert "[cfe] Remember built TypedefTypes for late bounds checks"
This reverts commit ce841aa40c.

Reason for revert: a crash in google3.

Original change's description:
> [cfe] Remember built TypedefTypes for late bounds checks
>
> Bug: https://github.com/dart-lang/sdk/issues/45334
> Change-Id: Idbc823ecc688f2679134c757dcf7a7ad12a02e24
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192146
> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/45334
Change-Id: I9ba9d02a29e17b58ddbf313dce70af8c9498c1a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193305
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-03-29 13:27:47 +00:00
Konstantin Shcheglov 7374f441f3 Add TypeProvider.isNonSubtypableClass, deprecate TypeProvider.nonSubtypableClasses.
Change-Id: I78beaaeb763c33420d84c33b0e87cd5310f99fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193094
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-29 02:33:52 +00:00
Brian Wilkerson 7f54fc96e5 Add documentation for several more codes
Change-Id: I012db56773acee6a81fbb6a33958beb686793ec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-28 21:16:11 +00:00
Konstantin Shcheglov 5621c9f767 Check for TYPE_ARGUMENT_NOT_MATCHING_BOUNDS when generic_metadata is enabled.
Change-Id: I32b4963f46c232a0ab41fb1b55ffe1c8723a34e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193160
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 23:56:46 +00:00
Brian Wilkerson 2802e4fbdc Make the map file explicit rather than trying to coordinate between caller and callee
Change-Id: I6f7b7807eeca7a023772c0bdcf4992e4762f84e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-27 22:42:56 +00:00
Konstantin Shcheglov 2c02737d7a Support for bounds of generic function types for raw-depends / not simply bounded.
Change-Id: I568f4ebb922b3ce40debff1f4ce20a9ac580f29d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193141
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 21:08:06 +00:00
pq a68db103ae rename lintProducerMap2 => lintProducerMap
(Also removes deprecated "legacy" lintProducerMap.)

Change-Id: I8c9222657029fe709228e010c4b90f34244814d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193086
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-26 14:50:04 +00:00
Paul Berry a7b0f5108d Flow analysis: implement "why not promoted" logic for compound assignments.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I57a2c62b8450c313887b516d6fe2ef85fdd0d92b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-26 00:29:24 +00:00
Paul Berry 79bf4f33ae Clean up nomenclature around whyNotPromoted.
We used to have some variables called `whyNotPromoted` and others
called `whyNotPromotedInfo`, with no obvious distinction between the
two names.  Now we use `whyNotPromoted` for variables holding the map
returned by `FlowAnalysis.whyNotPromoted`, and `whyNotPromotedList`
for variables holding a list of such maps.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I3823d16ef908a833e4d4526ae1c3576c73ecf1fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-26 00:29:24 +00:00
Paul Berry 52a1fb3de2 Flow analysis: refactor handling of try/catch/finally in unit tests.
We now use a single AST node to represent try/catch/finally rather
than separate try/catch and try/finally nodes.  This more closely
parallels the data structures used by the analyzer and CFE.

Change-Id: Ic4c1f1e4ac9e10ebf36afa4047c9c8b9ce151a1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193093
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-26 00:16:54 +00:00
Paul Berry e32ddc132f Flow analysis: refactor handling of this in unit tests.
The type of `this` is now stored in the test harness rather than in
the individual `this` AST objects.  This more closely parallels how
`this` is handled in the analyzer and CFE.

Change-Id: I7c60aec8a14680beecca161ad25d681b82f79a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193092
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-26 00:16:54 +00:00
Paul Berry f7419efa93 Fix some mismatched variable names in a flow analysis test.
Change-Id: I69f9822f9fe0e935a40fac0fced2d1512c234a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193089
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-26 00:16:54 +00:00
Mark Zhou 8590d3c615 [dartdevc] Porting more expression eval tests.
Also changing strings resolved from JS objects to be more like those seen in the Chrome console.

Change-Id: I52adf2add57822f296eb93b49028f75202e02c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193064
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-03-26 00:04:04 +00:00
Konstantin Shcheglov 92130a010e Tests for DAS services and generic annotations.
Change-Id: I063c78ae778366e60bb0d4aca55c4e7fd70f3d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193091
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 23:38:24 +00:00
Kallen Tu 51b0832516 Language tests for erroneous conditions in control flow statements.
Conditions which are not bools. The error checking should be handled by the compiler so asserts added just in case.

Change-Id: Ia53c7aa017300f5afbfe636604855e4183e1d0a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-25 23:21:34 +00:00
pq c8d115bd06 remove unnecessary parens in string interp
Change-Id: Ib1fd19d20375c5aa4284953d1ced9be2b0dac2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193085
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-25 22:24:34 +00:00
Ryan Macnak 6a6e08b784 Reapply "[vm, compiler] Convert binary Smi ops to graph intrinsics."
Explicitly disable unboxed parameters for these functions, previously implicitly disabled by virtue of being ASM intrinsics.

TEST=ci
Change-Id: Ic810bb8400e081c5f99a49b5035031bc9edc4bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-25 21:54:44 +00:00
Konstantin Shcheglov 4af81e2a5b Issue 45459. Report EXPERIMENT_NOT_ENABLED instead of INVALID_GENERIC_FUNCTION_TYPE when nonfunction_type_aliases is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/45459
Change-Id: I0773f15e4697620427f4449622a592e40b5a5de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 21:43:04 +00:00
Joshua Litt 2febc7d526 [dart2js] Create abstractions to support bundling.
Change-Id: I2d8a7ecae963aa5b51e1405652633b72545f7cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191468
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-03-25 20:59:14 +00:00
Janice Collins 182eb2d5c5 Try removing an extra null check in cloneNullableToken.
When trying to update to analyzer 1.3.0 dartdoc started crashing
occasionally in CI with the following exception:

https://github.com/dart-lang/dartdoc/pull/2589/checks?check_run_id=2195215917#step:6:3411

Reading the code suggests that returning a null here should be an
OK thing to do, but if this is intended to enforce that an invalid
key should never be passed to this method, some other solution
will need to be found.

Change-Id: Id210a0f8feb6197e7a65569bfaed4d599be4b3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2021-03-25 20:48:54 +00:00
Dmitry Stefantsov ce841aa40c [cfe] Remember built TypedefTypes for late bounds checks
Bug: https://github.com/dart-lang/sdk/issues/45334
Change-Id: Idbc823ecc688f2679134c757dcf7a7ad12a02e24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192146
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-25 20:31:24 +00:00