Bug: https://github.com/dart-lang/sdk/issues/49350
Checks to see that external extension members on `@staticInterop` types
do not declare or use a type parameter.
Change-Id: Id8646b599094b748c5490810b64d872065676014
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254103
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
This CL also changes the runtime algorithm to fully substitute
interface type parameters before performing type checks. This change is unfortunate, but necessary so that normalization of types works as expected. In the longer term we should cache generated types to avoid redundant work.
Change-Id: I9441ccdea8c6a9ac598cae043937cf683616d227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262821
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
This change replaces the InferenceVisitorImpl.visitSwitchStatement
with a call to the new shared type analyzer, and implements the
necessary callbacks to allow analysis to work end-to-end.
Change-Id: I73a9514428b4ce092762d3ea450545986d0e1ea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257491
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Fixes issue where --enable-experiment options passed after `dart
run` weren't being handled by the VM.
Fixes https://github.com/dart-lang/sdk/issues/50205
TEST=pkg/dartdev/test/commands/run_test.dart
Change-Id: Ia9c585a16756fd4450cfd159a1b9864ebfb6d200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264200
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Change-Id: I6b26b6171b35d22cdb706d96fdb0045eef7e7264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264100
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Wasm `i64.div_s` result[1] is undefined when the division result is
2^63, and v8 traps with "divide result unrepresentable".
This change follows the checks in native runtime (in
`Integer::ArithmeticOp`) to handle overflowing in
`-9223372036854775808 ~/ -1`:
case Token::kTRUNCDIV:
if ((left_value == Mint::kMinValue) && (right_value == -1)) {
return Integer::New(Mint::kMinValue, space);
}
return Integer::New(left_value / right_value, space);
These tests now pass:
- corelib/integer_parsed_div_rem_vm_test/01
- language/operator/left_shift_test
language/operator/arithmetic_test used to fail with the same trap, but
it now fails because of #50228.
[1]: https://webassembly.github.io/spec/core/exec/numerics.html#op-idiv-s
Change-Id: Ib43ac7a53d5cf96c01b016f73240da533ef84516
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264460
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Tested: No new behaviour. Covered by prior tests.
Change-Id: I739649a53c3982b673b1144e3c5aa98cc75f98a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263042
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Tested with:
* top-level variables
* local variables
* instance and static fields declared in classes and mixins (enhanced enums are not supported pre-null safety)
Fixes https://github.com/dart-lang/sdk/issues/41389
Change-Id: I8a89668fffe64fff508d0aeb36aaebef5c84f223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263460
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
There was no need for both of these listener callbacks, because they
were always called together. Since `beginCaseExpression` is actually
used, it makes sense to keep `endCaseExpression` and get rid of
`handleCaseMatch`.
Change-Id: I544096b2c2b2814e8cc0c8606455855cb77c9e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264102
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These are in their own CL so that it's easy to verify that no
functionalty has changed, even though a lot of parser expectations
files are affected.
In a follow-up CL, I'll add code that actually parses pattern guards.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I79f5a02df45e29b69aa4d8348cfdf27042ada9d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264020
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is a reland of commit 4c1235caab
The underlying problem is addressed in https://dart-review.googlesource.com/c/sdk/+/262429.
Original change's description:
> [vm] Cleanup unused code in ClosureFunctionsCache
>
> TEST=ci
>
> Change-Id: Ia6f24545c7e2d5b0df81cab52585d17556b36c16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256363
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Auto-Submit: Alexander Markov <alexmarkov@google.com>
TEST=ci
Change-Id: I96bd99174e68818ca8024e72836ebd1c99cdecd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263141
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The bare identifier `_` is treated as a variable pattern wherever it
appears, even though other bare identifiers are sometimes treated as
constant patterns.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I475ef627b6d0bf519a1972aa5ec683e2d032f02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263280
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
* required is a modifier when followed by [record type] `?`.
* Parse record type as record type if followed by `super` or `?` `super`
or `?` `this`.
* Typedef with record type follow by `?`.
* Parse record type as record type in get/set with async/sync/sync*.
* Parse record type as record type when followed by `>>=` or `>>>=`
(for weird formatted use in typedefs).
Change-Id: I19e208497e28780fb1505139c488e943751cce25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The language now prevents third-party implementations of Uint8List, so a regular `is` check guarantees a VM implementation.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/50194
Change-Id: I8b414e9609fe2f682dfbb16495a9efb99ecdd11c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264080
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Adds a slot to the vtable of all generic closures with a function
taking a generic closure and type arguments and returning a closure
representing the instantiation of the generic closure with those type
arguments. Instantiation operations then call this instantiation
function, fetched from the vtable of the closure to be instantiated.
The context of an instantiation closure contains the original closure
and the type arguments. The vtable of an instantiation closure
contains trampoline functions that call the corresponding entry point
in the original closure with the instantiated type arguments.
The instantiation functions are shared between all closures with the
same representation. The trampolines are shared across representations
for the same vtable entries.
For now, the instantiation closure just inherits the runtime type from
the original closure, which means that its runtime type will be
incorrect. When we support generic function types with runtime type
substitution, we can perform such substitution when instantiating
a closure.
Change-Id: I5d3a4d623c0673f9c2188f8a7ddd5b28b9404ac4
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262201
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
convert (f0acc6b..4feeb10):
4feeb10 2022-10-12 Kevin Moore Fix comment references, update lints, require latest Dart SDK (#69)
8d8c1d3 2022-10-12 Moritz Bump version for publication (#68)
stack_trace (2194227..9697e4c):
9697e4c 2022-10-12 Kevin Moore Enable browser testing on CI, fix one test with browser-specific issues (#120)
6af4349 2022-10-12 Kevin Moore Fix comment reference issues, among other new lints (#119)
webdriver (e1a9ad6..f56cc6a):
f56cc6a 2022-10-11 Nate Bosch Throw UnkownCommandException for 405 status code (#255)
63d58f0 2022-10-11 Tijo Jose Make the `waitFor` utilities return `Future<T>` instead of `Future<T?>`. (#254)
Change-Id: Iecf27c64bc05b9937a93e6f8f555b3cfe893ee36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263980
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>