Change-Id: I042f6047c2c10490121398027489217c6291425d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211622
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This includes an allow list for the diagnostics that we're already
approved, and we can add more as needed, but I don't want us to have
multiple bulk fixes without first confirming that they are mutually
exclusive. This should help prevent an oversight.
Change-Id: I73c4a52e36005f256b416372bfbf8bf7db38400e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214424
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
These tests were added to test the forked NNBD SDK but the SDK has long
been unforked.
Bug: b/200928253
Change-Id: Idb0891c2141a09320bf7779c260c79ec868f0ad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214402
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
When looking for a dispatch target, also cache not found selectors
to avoid repeated lookups.
Improves time of AOT compilation step 2 (TFA) on a large
Flutter application 189s -> 171s (-9.5%).
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/42442
Change-Id: I21686e1f40a09ef62abf010bfa3670615c108942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214342
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Sort `a.dart` before `a/b.dart`
Fixes https://github.com/dart-lang/sdk/issues/45321
Change-Id: Ic16cf3dc1d0651e450cc476bf02d86afa9abf3fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214310
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Change-Id: I053668459b21e10e2a3f7343296f913f82118768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214309
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This test is flakily failing on iso-stress builder and this is an
attempt to get more information about why it fails sometimes.
TEST=Makes test produce more useful information.
Change-Id: Id1c2e74c9dda69b61ba2b19f553640c801566f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214382
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Previously, we had a rule in the migration tool that we didn't add
`!`s to the literal `null`, because such a change would be guaranteed
to fail at runtime; instead we issued a warning to the user that there
is no valid migration for their code, so user intervention is
required.
This change extends the rule to apply to any expression whose type is
`Null`. Notably, this makes migration of code using Mockito much
easier, because it prevents the migration tool from trying to add a
`!` to expressions like `any`, `anyNamed(...)`, `argThat(...)`,
`captureThat(...)`, etc. (all of which have a return type of `Null`).
Bug: https://b.corp.google.com/issues/200173910
Change-Id: I70ce5da5002e6254397024da5a9e9f69eb04f21c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214313
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The documentation on `Future` and `Stream` was only showing
the class API, not `async` programming.
Added examples of using `async`, `async*`, `await`, `await for`,
`yield` and `yield*`.
Fixes#47082
Bug: http://dartbug.com/47082
Change-Id: Ib8b4e8642412073e9e6124429d66747c277f89a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212470
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This adds a third reference to Field declaration, so that we know have
three references, one for each use case:
1) fieldReference used for initialization; in FieldInitializer and as
the key in the InstanceConstant.fieldValues map.
2) getterReference used for reading; in InstanceGet, StaticGet and
SuperPropertyGet
3) setterReference used for writing; in InstanceSet, StaticSet and
SuperPropertySet
TEST=existing
Change-Id: I223f130e808e7f19a831c1fe5e3a4725d1bcdc3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203770
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This change moves tests out of the older-style test file. In addition:
* additional tests for uninstantiated function tearoff identity.
* additional tests for using a type parameter as a type argument in a
function tearoff in a const expression.
Change-Id: I6c6a6db13144e02794a62d78337013b4a525549a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214139
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Removing usage of the foreign JS function from the js_util
CFE optimizations. Keeps foreign JS calls only injected by
the compilers. There will be no change in generated JavaScript
for dart2js, it was already inlining getProperty calls. There
will be a small change for generated JavaScript for ddc, but
we will work on adding a simple ddc inliner to account for it.
Change-Id: Iadcc81a6798a8af397205bf6bb89d0bfbd095432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214306
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Swap to finding the mapping of Procedure to ExtensionMemberDescriptor
data, instead of using the front_end desugar api for extension
member kind, name, and isStatic information.
Change-Id: I4bca55e8f1d3044def420060ddecc75600452a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214305
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
The AOT runtime is not supported on IA32, so generating snapshots and
executables requiring the AOT runtime is not possible on IA32.
Fixes https://github.com/dart-lang/sdk/issues/47177
TEST=pkg/dartdev/test/commands/compile_test.dart
Change-Id: I99e9a16f6a93b3b63b8ed15acc1472f9ca619c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213680
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Bug: VM service `addBreakpointWithScriptUri` and `addBreakpoint` don't add valid breakpoints for code in `dart:` libraries. See #47204
This PR contains :
- a new test : 'service/break_on_dart_colon_test.dart', that checks several URIs to register breakpoints in `dart:` libs.
- a fix in `Debugger::SetBreakpointAtLineCol` to make it calls `Library::LookupScript'` with the right value for `useResolvedUri` parameter.
Fixes https://github.com/dart-lang/sdk/issues/47204
TEST=runtime/observatory/tests/service/break_on_dart_colon_test.dart
Change-Id: Id3d6722c278e3238202a9d84a0d34612b957035c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213766
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
I hoped to get hints on why we get out of sync with the number
of classes, getters, etc in the AST and the element model. Unfortunately
it don't not help, we might have a unit without any variables, the
corresponding code, but AST has variables.
So, this code does not help, and I want to remove it.
It was also used for Move File refactoring, we would need some different
solution later. For now I revert to the state it was not long ago.
Change-Id: If7468aac33ce000f85e94f96bfa2d2966892e560
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I2c3d97b5b999e03682e60a6a62947257f597c182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214308
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This paves the way for code generation of the `TodoCode` class.
Change-Id: I25e113f90194f3f7ac5ab0ae2a17b9836e56b835
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
I maintain the choice to _not_ rewrite a PrefixedIdentifier to a
ConstructorReference in the case that it is the left side of an
AssignmentExpression, because doing so requires extra additional
checking during assignment verification, and probably a new error code
saying a constructor cannot be assigned to, similar to the error code
saying that a method cannot be assigned to. This is all feasible, but
I think it is very reasonable, in AstRewrite, to say, "This prefixed
identifier does seem to refer to a constructor, but it's the left
side of an assignment, so I'm not going to confidently do a rewrite;
instead I will leave this alone and let the assignment verification
code handle it."
Bug: b/200948019
Change-Id: I90c6a157c2992d4935acfb593f38518f0388bced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
When checking if type parameters are equivalent for subtyping,
check both base and index of the type parameter to avoid matching
type parameters from different levels. For example, consider
the following function types:
void Function<S>(S val) Function<T>(T val)
void Function<S>(T val) Function<T>(T val)
Also, when instantiating a signature of a closure, correct
base/index of type parameters even if they are not instantiated.
TEST=language/function_subtype/nested_function_type_test
TEST=language/closure/nested_generic_closure_test
Fixes https://github.com/dart-lang/sdk/issues/47265
Change-Id: I6f75a4ee70435f42afeb772e7ecc680ab75a7520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214136
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Add dart-lang/co19 in front of #123 issue references.
* Update the co19_2 script to match the co19 script.
* Track main from the roll branches.
* Add a comment between the two co19 hashes to prevent merge conflicts.
Fixes: b/200911019
Change-Id: I2806ac7e9cd5ff3d24cac0e50a1d094163b35d7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214046
Reviewed-by: William Hesse <whesse@google.com>
This makes it an *earlier* error if a `toString` method returns `null`
when passed to `print`, possibly a new error if the underlying platform's
print implementation let `null` through.
Returning `null` is something `toString` was never supposed to do,
and with null safety, it's enforced by the type system,
so only pre-null-safety legacy code can actually return `null`.
Makes the error message from `NotNullableError` not assume a parameter,
so it can be used in more places.
Bug: https://github.com/dart-lang/sdk/issues/47196
Change-Id: I7f10156330994d31e44384fa952dd88385e2628d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214043
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This CL enables the avoid_void_async lint in the CFE, makes the needed
changes and adds the missing `await` (because the lint
`unawaited_futures` doesn't react to void async methods).
Change-Id: Iffc1f173badd3c2d48356ee02e81a9aed492ce5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213481
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This is a reland of fb36bba5f2 with
a fix to the ordering to ensure all the expectations run.
Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
Change-Id: Id88aeaf0ddc783936d413c06099df031bc7cb0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214224
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Previously, we had an inconsistent convention for whether the class
name should be included when supplying an optional `uniqueName`
parameter to an error constructor. (Some error class constructors
added it automatically, others didn't). And we didn't always follow
the convention properly, so some errors were missing the class name
from their `uniqueName` property.
This change adopts the consistent convention that we never include the
class name when supplying an optional `uniquename` parameter to an
error constructor; it is always added in automatically by the
constructor.
Change-Id: Iff7a213b9fe05b1539c22bdbf935c6e54d49f3e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Please see https://github.com/dart-lang/sdk/issues/47264
The Flutter team would like to turn this on in product mode for being
able to systrace release applications.
This change could have potential size and performance regressions and
will be monitored as it rolls into Flutter. If the impact is not within
acceptable ranges it can be rolled back.
TEST=ci
Change-Id: Iad6f9b831eaf60d15f03e368702fb25bc9ebc76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214241
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This reverts commit fb36bba5f2.
Reason for revert: New test fails on windows configurations.
Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
TBR=johnniwinther@google.com,nshahan@google.com,annagrin@google.com
Change-Id: Iedfc4c1a5b24b515646d4f1b486bcb2f19bb7783
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214222
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Ensure frontend server builds for the `DevCompilerTarget` add the
environment variables needed for `bool.fromEnvironment()` calls for
conditional imports.
Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
Fixes: https://github.com/dart-lang/sdk/issues/47207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
CFE transformation to add a function body for external
extension methods. Routes to `js_util.callMethod` with the
arguments in a ListLiteral to then be further optimized to
the `callMethodUnchecked` version if possible.
Change-Id: Iccdda7b8c16c19b37e20b7cbceb8c32498e64d3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213721
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>