Commit graph

89032 commits

Author SHA1 Message Date
Josh Soref 1ab011a2a7 Spelling tests web
Closes https://github.com/dart-lang/sdk/pull/50879

TEST=only changes to spelling to comments and internal string messages
GitOrigin-RevId: 3fa4104fa17054ea2247118a1b6213c62f2749e0
Change-Id: I776120bb2492c662dd32612dd2f6a670b5891e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278060
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-01-05 01:26:52 +00:00
Jackson Gardner 4970f7fa82 [dart2wasm] Emit code for assert initializers.
Change-Id: I0eb69de0027e51c7b821c2da045fe91d65ab4dc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278091
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2023-01-05 00:23:40 +00:00
Simon Binder 3b1fbb9cd8 [analyzer] Add facility to instantiate record types
This adds the `recordTypeWith` method to `TypeProvider`, a method
instantiating a record with provided positional and named fields.

By instantiating specific record types, we can match user-defined types
against specific record structures, for instance to validate that a
user-defined type is compatible to a certain record. For me, this would
be a helpful addition to the analyzer's public API.

Change-Id: I52e70eb0cbb0a0edf919b7b0f8901e6de1e00a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277401
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-01-04 22:35:28 +00:00
Konstantin Shcheglov c7f509379d Report NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION
Change-Id: I2ef6ad04d9dfcc51faa239ddeae3122bfe969672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278366
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-04 22:23:38 +00:00
Devon Carew e6c14da280 [deps] rev bazel_worker, benchmark_harness, boolean_selector, browser_launcher, clock, crypto, csslib, dartdoc, html, http, http_multi_server, intl, package_config, pool, protobuf, pub_semver, source_map_stack_trace, source_maps, source_span, sse, stack_trace, stream_channel, term_glyph, test, test_descriptor, test_process, test_reflective_loader, watcher, web_socket_channel, yaml
Revisions updated by `dart tools/rev_sdk_deps.dart`.

bazel_worker (9f21e1d..b35c25e):
  b35c25e  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#66)

benchmark_harness (ee7a253..76881df):
  76881df  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#80)

boolean_selector (5082b3d..ba7d86b):
  ba7d86b  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#41)

browser_launcher (2712dda..f2f01e4):
  f2f01e4  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#37)

clock (8a8231f..6b8b7bf):
  6b8b7bf  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#41)

crypto (bf0c33b..f854f2f):
  f854f2f  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#138)

csslib (34203c0..d776535):
  d776535  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#156)

dartdoc (ce25524..9ed196f):
  9ed196f1  2023-01-03  Sam Rawlins  Move many test files to test_reflective_loader (#3284)

html (28fb8b9..3dd00b0):
  3dd00b0  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#193)

http (38d5dd9..d434d42):
  d434d42  2023-01-03  Brian Quinlan  Make it possible to use a custom CronetEngine with runWithClient (#843)

http_multi_server (e31c698..beb40a7):
  beb40a7  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#47)

intl (59e7bff..c61fdd1):
  c61fdd1  2023-01-04  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#528)
  2a5e3a2  2023-01-04  Copybara-Service  Merge pull request #527 from mateendev3:patch-2
  07a5847  2022-12-31  Mateen Mehmood  Update date_format.dart

package_config (abb4aec..2e1a8ec):
  2e1a8ec  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#128)

pool (1ea5b03..713e631):
  713e631  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#59)

protobuf (1d1c92a..dd04535):
  dd04535  2023-01-04  Mahdi K. Fard  Fix avoid_renaming_method_parameters linter warning. (#783)
  4b1fc34  2023-01-04  Mahdi K. Fard  Removes a non-existing lint rule. (#784)

pub_semver (1723111..3946e33):
  3946e33  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#76)

source_map_stack_trace (8d8078f..e5f9564):
  e5f9564  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#31)

source_maps (b031e2c..d995912):
  d995912  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#70)

source_span (d1d47e5..72d5c55):
  72d5c55  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#89)

sse (2de27fe..3c37edb):
  3c37edb  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#73)

stack_trace (cf3562e..c08ee90):
  c08ee90  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#125)

stream_channel (9143047..0a7800a):
  0a7800a  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#83)

term_glyph (822cd5b..2bf4594):
  2bf4594  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#30)

test (8235a25..3415089):
  34150897  2023-01-03  dependabot[bot]  Bump ossf/scorecard-action from 2.0.6 to 2.1.2 (#1838)
  5f01dd97  2023-01-03  dependabot[bot]  Bump github/codeql-action from 1.0.26 to 2.1.37 (#1839)

test_descriptor (13dbc20..b73c691):
  b73c691  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#46)

test_process (1774aa7..62ea2ba):
  62ea2ba  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#37)

test_reflective_loader (52b6753..cf58259):
  cf58259  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#43)

watcher (3259107..2e0db71):
  2e0db71  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#132)

web_socket_channel (a90e740..ebd0fe9):
  ebd0fe9  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#244)

yaml (f699275..02be51e):
  02be51e  2023-01-03  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.2.0 (#133)

Change-Id: I56af76e89a75b0712b290ea154f606781183bec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278368
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-01-04 21:48:02 +00:00
Brian Wilkerson 1170c55eaa Update the checklist for new language features
Change-Id: I4022bd3a79be25d006178ad681effd035ff7f9d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277045
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-04 21:47:32 +00:00
Konstantin Shcheglov 445085471d Report NON_CONSTANT_MAP_PATTERN_KEY and EQUAL_KEYS_IN_MAP_PATTERN.
Change-Id: I20922047abe62292b84798b7cf540d93f1b5f0d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-04 21:21:30 +00:00
Nate Biggs 1469539e65 [dart2js] Fix type of _RecipeToIdentifier.
Change-Id: I59396791e23b5ea96848afeb087c795be389e041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278420
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 20:49:01 +00:00
Konstantin Shcheglov 79e6beaf7d Prepare to publish analyzer 5.4.0 and _fe_analyzer_shared 52.0.0
Change-Id: Iafb9a1f8d5ce9f8502795192c9cbc6b26cb337c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278300
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-01-04 19:33:48 +00:00
Konstantin Shcheglov 6669eca110 Separate LogicalAndPattern and LogicalOrPattern.
Change-Id: Ie1202dc99cdddd59f0233992dd15b521758990e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278301
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-01-04 19:08:39 +00:00
Nate Biggs cb87060664 [dart2js] Clean up leftover null safety hints.
Change-Id: Iebc59835018d2181760d3b6afc4cf18988c9dfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278260
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs a1dc4a9e76 [dart2js] Migrate memory compiler and helpers to null safety.
Change-Id: I578549e18acfeba4c450033b76959a0899b11fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278244
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 0a8521f2da [dart2js] Migrate more files outside of the main dart2js app.
Change-Id: I9f717f70e7166f449196d71b1c06967553dbb0cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278243
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 692a4950b0 [dart2js] Clean up null safety migration partial migrated files.
Change-Id: Ieecbad0b192a65118a7aa1e400a792661a339a3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278242
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 093d67157a [dart2js] Clean up null safety migration interfaces for compiler.dart.
Change-Id: I8aa5ef1600648262e605073c36ad31af3e46b0ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278241
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs ddb9b8f7a7 [dart2js] Clean up some null safety migration interfaces.
Change-Id: I5c4d813ba724b9649e3687b0b4b69a68b26cd0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278240
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 3b908b472c [dart2js] Migrate dart2js.dart to null safety.
Change-Id: Ib59ad07d117dffa99e53f1ea67c103dbfdcc1114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277303
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 6df1184015 [dart2js] Fix null soundness issues before migrating last file.
Change-Id: Icfdd44b34b260f269f4a50f3a12d99f7be11697f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277304
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 12aa078024 [dart2js] Migrate compiler_api_unmigrated.dart to null safety.
Change-Id: I2484ac5ccd5210d7422f304e45927307091c0e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277302
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs cf0c7fa3a0 [dart2js] Migrate compiler.dart to null safety.
Change-Id: I8b075124942f8eb5d3febb979de6d3aa6340f760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277301
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 5eaed3a444 [dart2js] Migrate js_model/js_strategy.dart to null safety.
Change-Id: I66ae330d1ea8a732343429f019645e6c9f30921d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277300
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 746a88c834 [dart2js] Prep js_model/js_strategy.dart for null safety migration.
Change-Id: Ia4eb541de5671850c34633d466ef2d7f0d50bbdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277280
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 44764291b1 [dart2js] Migrate ssa/ssa.dart to null safety.
Change-Id: Iab3caf10b2cb26ab22c4f97a64f540b70ca15bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277261
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs c9adf3f1f3 [dart2js] Clean up ssa/builder_interfaces.dart.
Change-Id: I1a42b5c5521dc1494bff9bd8015842770d555288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277260
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 90d89acc59 [dart2js] Migrate ssa/builder.dart to null safety.
Change-Id: I57ff3a451319b298d86b32d7e3a2b97ad4c76541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277220
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Vyacheslav Egorov 15230e41e5 [vm] Improve crash output from gen_snapshot
* Don't compile it with omit frame pointer even in PRODUCT.
* Dump the first frame even if we give up on unwinding.
* Dump compiler state even if we give up on unwinding.
* Don't abort stack dump if PC for the outermost frame is 0 (can happen
when calling pure virtual method for example).

TEST=manually tested by making compiler crash during code generation

Change-Id: Iddeafbdad8e8588f19197d5dd49af14b8fc63134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278341
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-04 18:14:56 +00:00
Danny Tuppeny 792aedec74 [analysis_server] Add syntax highlights for error/stackTrace in catch clauses
Fixes https://github.com/Dart-Code/Dart-Code/issues/4320.

Change-Id: Iad269d0f5389d548a01717fbd0facd74d31acf50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-04 17:59:01 +00:00
Ömer Sinan Ağacan 79be4f965a [dart2wasm] Simplify getter and setter forwarder types
This separates setter, getter, and method forwarder types. Setter
forwarders now only take a receiver and a value arguments. Getter
forwarders take only a receiver argument. Method forwarders are the same
as before: a receiver, lists for type, positional, and named arguments.

This is mainly to allow passing more arguments to the method forwarders
without having to pass dummy values when calling getter and setter
forwarders. For example, the vtable entry to fix #50661.

This also fixes return values of field sets (when there is no setter).

New passing tests:

- language/getter/setter_interceptor_test
- language/if_null/assignment_behavior_runtime_18_test
- language/if_null/assignment_behavior_runtime_20_test
- language/if_null/assignment_behavior_runtime_25_test
- language/optimize/setter_test

Change-Id: I17381fba04f089b974d6c435e4c38dc90b7e5527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277986
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-01-04 17:07:22 +00:00
pq 7233f3c500 share common state instances
Change-Id: Idd3c97f0a12f9416d47338f64921dfd0f2251cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278096
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-01-04 17:05:48 +00:00
Josh Soref 512b540664 Spelling runtime: deduper
Closes https://github.com/dart-lang/sdk/pull/50807

TEST=ci

GitOrigin-RevId: 81d5ac80c1dcc65e784585c7bc61724a3b8c36ec
Change-Id: Iaaaac18a9b2edc1f709e690b6ebcffc37993f25a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276802
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-04 16:00:26 +00:00
Chris Swan 283db56d26 docs: Clarify SDK checkout process and d8 source
Closes https://github.com/dart-lang/sdk/pull/50885

GitOrigin-RevId: c7f915cb937e8a0e85b3070fa174c8a07fb8658e
Change-Id: I02b0e9d2c0e3225dc4214736c161bec509c59670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278142
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-04 15:49:18 +00:00
Sam Rawlins 160f64c672 Avoid implicit dynamic in TypeAnalyzerErrors
Change-Id: Ieeba38c75cb674ac79dbfa8259cdccd7e1cd5003
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-01-04 15:41:12 +00:00
Alexander Markov b205ea18cb [vm] Fix compiler crash when returning a value of uninitialized late variable from async function
This change fixes CompileType::CanBeFuture() which previously attempted
to use Class objects by class id without first checking if cid is internal.

Cid can be internal (SentinelCid) when CompileType::CanBeFuture() is
called for a return value of an async function when it is returning
a value of an uninitialized late local variable (such Return
instruction is unreachable).

TEST=runtime/tests/vm/dart/regress_flutter117892_test.dart
Fixes https://github.com/flutter/flutter/issues/117892

Change-Id: I63f0ca32d6246487f5c33d983cef9bd22aaa2fb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278094
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-01-04 15:26:34 +00:00
William Hesse ade4e52fa5 CP issue template assignees - remove whesse
Closes https://github.com/dart-lang/sdk/pull/50822

GitOrigin-RevId: 05e2bf239061b37442cf427fe33a67cd238a4b04
Change-Id: Icf6b047f703af38e4763b299202082bc5ac931b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277020
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-01-04 15:20:53 +00:00
Johnni Winther df9b753dc2 [cfe] Add support for inline class field access
The representation field of an inline class is not part of the
generated code - it does not have a corresponding synthesized top-level
methods like the other inline class members. Therefore, to support
access to the representation field, a new `representationName` field
is added to `InlineClass` that holds the name by which the
representation field can be accessed.

An access to the representation field is at runtime an access of the
receiver itself. To show that the static type of the expression changes
from the inline type of the receiver to the declared representation
type, an `AsExpression` is inserted. Since this check is not needed
at runtime, this node is marked with the new `isUnchecked` flag, that
backends can use to skip the check.

TEST=pkg/front_end/testcases/inline_class/field_access.dart

Change-Id: I635af414af2ddc541352078766ce57a9d8ded601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277983
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-04 14:46:03 +00:00
Johnni Winther dffa3191b9 [cfe] Handle case const
This push the constant context for constant patterns such that
the constness is propagated to subexpressions.

Closes #50629

Change-Id: Idcb279765c5464ba17abb98b3f9eb852a7c87b96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277860
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-04 13:37:54 +00:00
Haidar cbe458703c [vm/api] Make CObject as_string const char* instead of const
Closes https://github.com/dart-lang/sdk/pull/50884

TEST=ci

GitOrigin-RevId: f898451bb21f1e49550698fcf08ec5dfc1036dce
Change-Id: I808d37afe3e953afd632e4ffc4ab4b152b468e4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278140
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-04 12:51:03 +00:00
xiao xiao 7fa17936a6 [samples/ffi] Use the function arguments instead of static value
TEST=samples/ffi/async/async_test.dart

Closes: https://github.com/dart-lang/sdk/pull/50890

GitOrigin-RevId: 265298d1529dc01a8ee75aff595a647878ece1bc
Change-Id: I688ffb2369f3028a2d490ae21f50e176c9227185
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278099
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-01-04 11:34:27 +00:00
Martin Kustermann 3915281b07 [vm] Remove has-declared-initializer flag on VariableDeclaration for parameters that are made mandatory
Our AOT compiler may make optional parameters mandatory (e.g. if all
call-sites pass the parameter). Doing so removes the need for the
[VariableDeclaration] to have an initializer, which we clear.

=> This CL also clears the has-declared-initializer flag on the
   [VariableDeclaration]

This makes the text representation of AOT-transformed kernel files
less verbose by not printing `has-declared-initializer`.

TEST=ci

Change-Id: Id12cdbc2899c6e1f378a01c27ef4ec8e0ca3f328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277987
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-01-04 08:25:25 +00:00
Konstantin Shcheglov 5c92be6acf Implement 'variablePattern' for CastPatternImpl.
Change-Id: I1432002e5f3d89c3774cbf3cc0a8188ecb3beb90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278089
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-04 02:06:04 +00:00
pq 31a354fbf4 [WIP] migrate lint maturity to state
See: https://github.com/dart-lang/linter/issues/3896

Change-Id: I83b5f1caf4036ea04c973fb2c43cdd37e4e5de31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-01-04 00:15:39 +00:00
Kallen Tu d9d841a016 [analyzer] Update BNF for class type alias' class modifiers.
Change-Id: I93b557e19a8536d37830f0aaf9157590ce1d19cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278092
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-03 23:31:27 +00:00
Ilya Yanok 18f30497ed nnbd: Add ! to nullable targets of cascades
Tested: added a test
Change-Id: I83ac3b26c49ba82cc3f3562a52c2bc9cb0db9f61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278100
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-01-03 23:14:48 +00:00
Ilya Yanok f57f4fef52 Move isSetupAssignment to the base class
This field was added to track the assignments in `setUp` function
in tests, so allow better `late` inference for variables that get
assigned in `setUp`. But this might be needed not only for
`EspressionChecksOrigin` but also for `DynamicAssignmentOrigin` and
`AssignmentFromAngularInjectorGetOrigin`, so I moved this field to
the base `EdgeOrigin` class.

Tested: added a test that fails without this change.
Change-Id: I9c7c6b2e8b21f94e80e505cf24f2072bd8df703a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277682
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-03 23:14:48 +00:00
Ilya Yanok 895287256e nnbd: fix late inference for cascades
Cascaded calls usually end up being `StatementExpression`s, and
for those dummy edges are added. But in a cascade, the result of
the expression is the same as the target, so these dummy edges
happen to affect nullability of cascade's target.

This fix just drops adding dummy edges for `StatementExpression`s
those expression is a cascade. I guess the better fix would be to
make dummy edges into suggestions, since AFAIUT, their meaning is
"it's fine to make this nullable" vs "this shouldn't be nullable"
added by the method invocation, so the latter should ideally win.
Not sure that will fit into the algorithm though.

Fixes: https://github.com/dart-lang/sdk/issues/49689
Tested: repro test now passes
Change-Id: I62b408c7307df4ea485b8a925cf4537fd9890024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277681
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-03 23:14:48 +00:00
Konstantin Shcheglov 922b56931b Join variables after switch expression patterns.
Change-Id: I854d77acf787d54fd51c9beb08e6fc0ee1566887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276768
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-03 22:11:58 +00:00
Konstantin Shcheglov 8c3198638e Report PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY
Change-Id: I658ebec7f7dbe90742e9e417c1f01e0584e145c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278088
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-03 21:45:43 +00:00
Konstantin Shcheglov ef2b69c965 Support PatternAssignment in NodeReplacer.
Change-Id: Iebc890aa80555800fb0cb5d1dda9ffcf08789412
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278087
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-03 21:35:27 +00:00
Konstantin Shcheglov 4a12a31bb6 Remove released features from 'latestWithExperiments'.
I also switched to code `Feature.class_modifiers.enableString` because
then it is easier to navigate to the feature (twice) and see if it is
release.

Change-Id: Ia730d7b22ded44472effd1d7534d2d5d5b01d275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-03 21:07:00 +00:00
Brian Wilkerson e2749d4949 Enhance the move to file refactoring to support moving multiple declarations
Change-Id: I9df0717686746d351927268cbd4ac02174886315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-03 21:01:57 +00:00