Commit Graph

89608 Commits

Author SHA1 Message Date
なつき ddc19f7f92 Suppress clang warning for musl libc inline
Closes https://github.com/dart-lang/sdk/pull/51191

GitOrigin-RevId: d7064c43adce0b115c79e818800e44ba4f60739e
Change-Id: Ie73e96c83294d43baf3be6772cb84705ba2d2712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280136
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-01 21:58:18 +00:00
Ahmed Ashour 2bc3d0ef6e [analysis_server] fix benchmark tests
Fixes #51207

Change-Id: I3bd20fa283ed60cfd3610edfc517a3872206f654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-01 21:56:27 +00:00
Ryan Macnak cb9ff115b4 [infra] Delete old configurations for the "misc" builders.
Change-Id: Iad4e1391933414a7823b74f310ec23020384eff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275983
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-01 21:25:32 +00:00
pq d0262f7468 stop reporting HintCode.{REMOVED_LINT_USE,REPLACED_LINT_USE}
See: https://github.com/dart-lang/sdk/issues/51214

Change-Id: Ib4ff736e4e5d4432d52c9583e465e46c3dc0232b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280218
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-01 20:55:04 +00:00
Paul Berry e71019c5a7 front_end: fix expectations files for patterns/or_pattern_errors.dart.
The behaviour of this test was changed by
https://dart-review.googlesource.com/c/sdk/+/279756, but the test
didn't exist at the time I ran the bots, so I didn't include the
appropriate expectations file change in the CL.

Change-Id: I7486f7ca480341b12228ff625a33307d61bac226
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280057
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2023-02-01 20:48:43 +00:00
Kallen Tu 6ee64808ce [cfe] Refactor error handling for all existing class modifier behaviour.
Change-Id: I925f008ef3a1522c4e60f283dbdbd0fb5b1e290c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280049
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-01 20:08:50 +00:00
Danny Tuppeny dac58febd0 [analysis_server] Don't use window/showMessageRequest unless client has explicitly expressed support
LSP currently has no capability for showMessageRequest and assumed all clients support it. They do not.

Until there's a capability (and clients have been updated to pass it), we should assume there is _not_ support for this. So that it can be used in VS Code, we accept a custom flag in experimental that indicates support for this (which the current VS Code extension is passing).

When there is an official capability we should treat either as an indication of this being supported, and then further into the future we can drop the custom flag.

See https://github.com/microsoft/language-server-protocol/issues/1635.

Change-Id: I7ca36555a5a10231f754faf6ae0ba199f791be35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280173
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-01 19:11:06 +00:00
Johnni Winther 404fbe553b [cfe] Always create PatternSwitchStatement when patterns are enabled
This ensures that an otherwise regular switch statement has the new
switch statements semantics; using == calls and allowing user defined
== implementations.

Closes #50871

Change-Id: I0908b3a0adce959fe65ca61c5e94cf2a5e3f7e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280109
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-01 19:08:54 +00:00
Johnni Winther 3e409e7b8d [cfe] Report error on map pattern type argument mismatch
+ update message for list pattern type argument mismatch

Change-Id: I49cad4c5b01222592ea535f05be7dcc46639a993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280172
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-01 18:42:19 +00:00
Paul Berry a661e436bd Flow analysis: change return type of assignMatchedPatternVariable to void.
No caller was using the returned value anyway.

Change-Id: I4e4a40918246dcfd3238e77972f3dd07ccc4b02e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280203
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-02-01 18:12:49 +00:00
Paul Berry baec6e2fff Flow analysis: Get rid of unnecessary call to declare.
It's not necessary to call `FlowAnalysis.declare` from
`TypeAnalyzer.analyzeDeclaredVariablePattern` because the call that
immediately follows, `FlowAnalysis.assignMatchedPatternVariable`,
completely overwrites the variable's flow model.

Change-Id: I8293672c7fefec7eddfb4d43c38d81d8dcbe9aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280202
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-01 18:12:29 +00:00
Paul Berry 167cf8e637 Flow analysis: implement type promotions for switch cases that share a body.
There are two ways type promotion can occur when switch cases share a body:

(1) the scrutinee variable (if any) might be promoted, e.g.:

    f(Object x) {
      switch (x) {
        case int _ && < 0:
        case int _ && > 10:
          // `x` is promoted to `int` because both cases promote the
          // scrutinee variable to `int`.
      }
    }

(2) explicitly matched variables might be promoted at the time of the
    match, e.g.:

    f<T>(T t) {
      if (t is int) {
        switch (t) {
	  case var x && < 0:
	  case var x && > 10:
            // `x` has type `T` but is promoted to `T&int`, because
            // both declarations of `x` are in a context where the
            // matched value has type `T&int`.
        }
      }
    }

The existing flow analysis logic handles case (1) without any extra
work, because those promotions are joined as a natural consequence of
the flow control join at the end of matching the cases.

However, flow analysis has to do some extra work for case (2), because
the two copies of variable `x` are associated with different variable
declarations (and hence have different promotion keys).  To ensure
that the promotions are joined in this case, we need to copy the flow
model for the two copies of `x` into a common promotion key prior to
doing the flow control join.

The bookkeeping necessary to figure out a common promotion key is
similar to the bookkeeping for logical-or patterns.

Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: I9ee4ec5d797dae28099aafbaf34fbbeeee5cd626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280201
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-01 18:04:35 +00:00
Keerti Parthasarathy 83539664d9 Wire up remove var and replace if else with conditional for patterns
BUG=https://github.com/dart-lang/sdk/issues/49960

Change-Id: I1a2d6e69127d4d82ed2cd4a121572d0ff6c3af82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-02-01 17:33:07 +00:00
Paul Berry 459b2bf80e Flow analysis: implement type promotions for or-patterns.
There are three ways type promotion can occur in an or-pattern:

(1) the scrutinee variable (if any) might be promoted, e.g.:

    f(Object x) {
      if (x case int _ && < 0 || int _ && > 10) {
        // `x` is promoted to `int` because both sides of the `||`
        // promote the scrutinee variable to `int`.
      }
    }

(2) the implicit temporary variable that holds the matched value might
    be promoted, e.g.:

    f(Object Function() g) {
      if (g() case (int _ && < 0 || int _ && > 10) && (var x)) {
        // `x` has type `int` because both sides of the `||` promote
        // the matched value to `int`.
      }
    }

    For this sort of promotion to work, we need to

(3) explicitly matched variables might be promoted at the time of the
    match, e.g.:

    f<T>(T t) {
      if (t is int) {
        if (t case var x && < 0 || var x && > 10) {
          // `x` has type `T` but is promoted to `T&int`, because both
          // declarations of `x` are in a context where the matched
          // value has type `T&int`.
        }
      }
    }

The existing flow analysis logic handles cases (1) and (2) without any
extra work, because those promotions are joined as a natural
consequence of the flow control join at the end of matching the
logical-or pattern.

However, flow analysis has to do some extra work for case (3), because
the two copies of variable `x` are associated with different variable
declarations (and hence have different promotion keys).  To ensure
that the promotions are joined in this case, we need to copy the flow
model for the two copies of `x` into a common promotion key prior to
doing the flow control join.

The bookkeeping necessary to figure out a common promotion key is
similar to the bookkeeping necessary to track the association between
the individual declared variable patterns and the joined pattern
variable (and this is bookkeeping that flow analysis is already
doing).  So as part of this change I went ahead and removed the
`getJoinedVariableComponents` method (which was previously used by
flow analysis to query this association).  This reduces the
constraints on the analyzer and CFE implementations by not requiring
them to do this bookkeeping themselves.

In the process I've made two additional small changes:

- I modified the logic for assigning types and finality to joined
  variables so that if there is a finality conflict but no type
  conflict, the common type is used; conversely, if there is a type
  conflict but no finality conflict, the common finality is used.
  This should help reduce follow-on errors.

- I added logic to ensure that if a variable is only declared on one
  side or the other of a logical-or, flow analysis still considers
  that variable to be definitely assigned.  This should help reduce
  follow-on errors.

Change-Id: I62f17adb6a51a583707c216ed48d941d1c621eea
Bug: https://github.com/dart-lang/sdk/issues/50419
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279756
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-01 17:18:17 +00:00
Ömer Sinan Ağacan da7520e059 [dart2wasm] Tweak toString and runtimeType of Float32x4 types
New passing tests:

- co19/LibTest/typed_data/Float32x4List/join_A01_t01
- co19/LibTest/typed_data/Float32x4List/join_A01_t02
- co19/LibTest/typed_data/Float32x4List/runtimeType_A01_t01

Change-Id: Ia826a9337ff55efa8cc21cad101c0da9e10086e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280162
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-02-01 17:07:40 +00:00
Nicholas Shahan bdc1ddd5a9 [dartdev] Enable create_integration_test
Bump build_web_compilers dependency in the web template
pubspec.yaml.

New webdev and build families of packages have been published
that work with the Dart 3 SDK so this test should work again.

Fixes: https://github.com/dart-lang/sdk/issues/51106
Issue: https://github.com/dart-lang/sdk/issues/51037
Change-Id: I854fafb683bff20786b1b31b0368d08b49029e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280053
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-02-01 16:47:38 +00:00
Ahmed Ashour 43dbc91025 Add year checking in PRESUBMIT.py
Fixes #47110

Change-Id: I88b20a1ad4cbc5be200db84563ad4024aebc419f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212469
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-02-01 16:31:32 +00:00
Ben Konyi c14cc6d75b [ package:dds ] Fix TypeError when attempting to debug DevTools requests
TEST=Manual

Change-Id: I043d52fe8863e2ea159300990db48dd05b7bc199
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280051
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-01 16:01:29 +00:00
Alexander Markov 8fc7881fc8 [vm/aot,dart2wasm,tfa] Approximate function types as Cone(Function) instead of Any
This enables devirtualization of calls to _Closure methods, as
_Closure is the only concrete implementation of Function.

TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_51190.dart
Fixes https://github.com/dart-lang/sdk/issues/51190

Change-Id: I7ba1357452993e7e1ea400a83e0201745d6df601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280050
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-02-01 15:58:43 +00:00
Alexander Markov aa27ce093a [vm/aot/tfa] Run TFA unit tests with sound null safety
TEST=pkg/vm/testcases/transformations/type_flow

Change-Id: I57b8f955423372a734b4739abc8e2c23eb16dc7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280180
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-02-01 15:53:27 +00:00
Danny Tuppeny 692adf85ef [analysis_server] Show more LSP client info in diagnostic pages
+ split LSP pages up because capabilities/registrations can be very long.

Change-Id: Ia352f2d1fcb2f7ed7e76108b14f9b23c82f61073
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280169
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-01 15:25:02 +00:00
Johnni Winther 7774ab46b7 [cfe] Report error on missing variables in or-pattern
Change-Id: Iaea20e0cab22c1d9b82229adc27aa18bcdc2e8c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280170
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-01 15:07:47 +00:00
Danny Tuppeny 72cb7dd238 [dds/dap] Map fileUri/uri fields in ToolEvents before sending to client
This handles cases where the running app/VM was unable to provide a file:/// URI (such as google3) by calling the VM Service to translate the URIs before providing them to the client (which likely only understands file URIs).

Change-Id: Ib0b5d554a21e14e04fac6c05e489f5cc03b8301c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280107
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-01 15:04:19 +00:00
Nate Biggs f203815ba4 [dart2js] Migrate tool/graph_isomorphizer and test/tool/graph_isomorphizer for null safety migration.
Change-Id: I9061386d97bed2e366b270e9f70eb5f2e4dff404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279801
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-01 14:30:22 +00:00
Nate Biggs 9bd27993e8 [dart2js] Migrate test/codesize/swarm/swarm_ui_lib for null safety migration.
Change-Id: I0c798d47b8e2611b704f74da6e1fbd2b3f22ad22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279800
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-01 14:30:22 +00:00
Nate Biggs fd2dcca9e1 [dart2js] Migrate test/codesize/swarm/swarm_ui_lib/view for null safety migration.
Change-Id: I98be16243f97e84251322bc9eabbc85fbc4da828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279781
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-01 14:30:22 +00:00
Nate Biggs 9dfdd3c45c [dart2js] Migrate test/codesize/swarm/swarm_ui_lib/touch for null safety migration.
Change-Id: I5cd5cb1aed032007370ce79b083b6fe60d774f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279780
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-01 14:30:22 +00:00
Chloe Stefantsova 88fb556c43 [cfe] Use instantiate-to-bounds to compute type of .values on enums
Closes https://github.com/dart-lang/sdk/issues/51189

Change-Id: I5b6db5e9d0d1d5b2c4c89db467e1c43b01419f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280167
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-01 12:43:26 +00:00
Ahmed Ashour 7972c10f4e [cfe] fix not found target for
`InlineClassBuilder`

Fixes #51069

Change-Id: I1827586f3fbf58adde469fa2123cf9497632d7b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280097
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-01 11:39:50 +00:00
Johnni Winther 93ebb9a852 [cfe] Handle general types in object pattern
Closes #50872

Change-Id: If1a8225b85e70bedb1391d6ee8d6d34a70015553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280118
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-01 10:24:44 +00:00
Johnni Winther e77907f755 [test] Extract test for "native"
This move the test of the "native" syntax, support by the CFE, to
a separate test. The test (expecting the syntax to _not_ be supported)
fails on the CFE but that has nothing to with the records/patterns
features which the remaining tests in syntax_test.dart require.

Change-Id: Idef0d8b58b24488bcd4e3318eac9638152056b2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280111
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-01 10:06:37 +00:00
Alexander Markov 6074b4ff0d [vm/compiler] Handle uninitialized late local variables at OSR entries
TEST=tests/language/nnbd/syntax/late_modifier_edge_cases_test.dart
(on vm-eager-optimization-linux-release-x64 configuration)

Fixes https://github.com/dart-lang/sdk/issues/51192

Change-Id: I8eea931722f665d6ee8e5fa2602ba6b08edb8a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280052
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-01 09:15:49 +00:00
Ahmed Ashour e663ff334d [cfe] better console messages
Bug #50938

Change-Id: If7ea9478f0b0fc24d45e453a82231bae1ebd50e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280098
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-01 08:57:47 +00:00
Stephen Adams 5164ecd5ec [dart2js] Add test for issue 51179
http://dartbug.com/51179 - the defaulted value of `s1` is `null` instead of the correct string `'default value'`.

Bug: 51179
Change-Id: I437d95d8a4a273fd014a005f6c40a9be05f45d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280138
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-02-01 03:29:49 +00:00
Anna Gringauze 6387f7345a Fix incorrect record types
- Access record elements starting from 1 when creating record type.
- Add record tests for the expression compiler.

Closes: https://github.com/dart-lang/sdk/issues/51197
Change-Id: I02af94a1f09cbcb9801b6b3a5b0effdfd33aab2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280204
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-02-01 01:56:38 +00:00
Kenzie Schmoll 101738ee72 bump the DevTools dep to version 2.21.1
Change-Id: I8f245cd0d8bfd1dd9ccd2d036dbe77f58d4c79e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280135
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-01-31 23:58:51 +00:00
Derek Xu 5577eafdba [VM] Add OSThread::GetCurrentThreadName() method
Some fields of `OSThread` are initialized by retrieving information by
calling OS functions. For example, `trace_id_` is initialized by calling
`OSThread::GetCurrentThreadTraceId()`. Similarly, this CL adds the
`OSThread::GetCurrentThreadName()` method and uses it to initialize
`name_`.

TEST=CI

Change-Id: Iee121d71e660be01ff684a298144fa7d59e3b61d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278662
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-01-31 22:37:30 +00:00
Brian Wilkerson d05ee1898a Completion support for object patterns
I wasn't comfortable with the previous approach of fixing one
contributor at a time, so I tried handling a single location all at
once. I think it worked better, and might be easier to review.

So what that means is that I think the tests and changes cover
everything that needs to be done for object patterns. If you see
anything I missed, please let me know.

Change-Id: Ia4a5e8ed1cb7c1f68a96d5856165b239126ddfd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-31 22:35:55 +00:00
Ilya Yanok 0117e75b41 migration: Don't generate casts of unrelated types
If we statically know the types are unrelated, there is like
no chance for the cast to succeed at runtime. This is likely
a sign that automatic migration went wrong somewhere and human
intervention is needed. The cast just delays the problem to
runtime. Skip the cast and let it fail at compile time instead.

Change-Id: Ib557650b368c8f2839029e8a2e54c6bf9474035b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280119
Commit-Queue: Ilya Yanok <yanok@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-31 22:21:11 +00:00
Stephen Adams 18cee8078a [dart2js] Implement get runtimeType for records.
Change-Id: I5befb8a499e0bfc9acd884189317f4da19fab750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280046
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-31 19:44:48 +00:00
Kallen Tu 95c1899b43 [analyzer] Report an error when extending an interface class or mixing in an interface mixin.
Change-Id: I868b8c89fa52edbcd05d7f06e3246196bbf3d952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279910
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-31 19:18:40 +00:00
Danny Tuppeny 6897faa67a [analysis_server] Add semantic highlights for assigned/declared variables and field names
Change-Id: I7d11497c9ca1646ab913aedbed0fe84b40215215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-01-31 19:16:03 +00:00
Kallen Tu b8bbff7e7e [analyzer] Add enhanced enum and more mixin tests for base error testing.
Change-Id: Iee78b7e1a8207db7aa003d9d5c37db58214a72a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280126
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-01-31 19:09:18 +00:00
Paul Berry 0ad96e6895 [analyzer] correctly handle continue inside switch
Fixes #51145

Change-Id: Ifee8c96d578c24a294e2ddacead3129a68d74b8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280084
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-01-31 18:53:27 +00:00
Alexander Markov 9be13288b0 [vm] Support multiple local variables with the same name in the same scope
When lowering patterns, front-end can add multiple distinct local
variables with the same name into the same local scope.
Previously, VM identified local variables in a local scope by name.
However, this no longer works with patterns.

With this change, local variables are now identified by pair (name,
kernel offset). Name is still taken into account as compiler can add
extra variables which do not correspond to kernel variables,
such as 'this'.

TEST=runtime/tests/vm/dart/regress_51091_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51091
Issue https://github.com/dart-lang/sdk/issues/49755

Change-Id: I0263769cb31f3f8d9652f5d6534800510ac882fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279650
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-01-31 18:47:46 +00:00
Brian Quinlan 252015b30b [io] Fix a bug where large reads would return partial data.
Bug: https://github.com/dart-lang/sdk/issues/51071
Change-Id: Ia64d803c9709b106e52a1c671c1c3288c051bd85
Tested: ci + new test
CoreLibraryReviewExempt: bug fix only for vm
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279204
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-01-31 18:41:39 +00:00
Ahmed Ashour d0131191bd [analysis_server] RangeFactory enhancements
Fixes #50959

Change-Id: I582706c0aea2597fd04dacb496e2ef16f055102a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278741
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-01-31 18:32:45 +00:00
Ryan Macnak 0c87126ea2 [vm] Finish removing legacy restart mechanism.
Cf. a4adbffb50.

TEST=ci
Change-Id: I9d2517c6cb0b5630990d087812e9a54241f41bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280043
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-31 18:28:59 +00:00
Jens Johansen ee32255b21 [parser] Support record type in pattern
Fixes http://dartbug.com/51169
Fixes http://dartbug.com/51176

Change-Id: Iaa38585ce311319f2f4c106fc979c99d931eaa15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280106
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-01-31 18:24:42 +00:00
Ahmed Ashour 1631284945 [analysis_server] update header of Flutter mock files.
Bug #51184

Change-Id: Ic8eda3e07858b3533f65bef4e2133d0da74e5209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280117
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-31 18:20:56 +00:00