The name being passed to the constructor didn't match the name of the
declaration. I chose to favor the name of the declaration, since it
more closely matched the similar error
`ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR`.
Change-Id: I74e3c2a6411db85695ef6d9b4851602a29209a09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Appears to be consistently failing on all other backends.
Re-enable this test if it is decided that this should be the
correct behavior.
Change-Id: If5016d23954748c0cb193f2f5faedb9f12820b5f
Issue: https://github.com/dart-lang/sdk/issues/44395
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214481
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Lets AppJIT training happen directly, instead of the absurdity of arm64 (hardware) running x64 (Rosetta) running arm64 (VM's simulator).
Change-Id: Idbf82530d946099db80c550070257c4c6ead31e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214763
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This is to satisfy TSAN where it sees a data race between updating a field on RecordStore and loading the field for cloning. We already use relaxed stores for Field's guarded_cid updates.
Fixes https://github.com/dart-lang/sdk/issues/47188
TEST=ci
Change-Id: I37e1aa4fc6ad8682210b3a76886a84673fb062cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214861
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This ensures that the relocated addresses of sections with file contents
are contained in the loaded segment.
Fixes https://github.com/dart-lang/sdk/issues/47289
TEST=vm/dart{,_2}/use_save_debugging_info_flag
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I6f7f94900ab1f9f0cb5ead4b0dd63bd2402e5a19
Fixed: 47289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214800
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This CL adjusts the test
language/constants_2018/constant_types_test
such that it expects no error when a type variable is used as a
potentially constant expression.
This feature was added for consistency as part of the constructor-
tearoffs feature bundle (because it can now be expressed anyway).
Change-Id: I5b58f2439699b24e3e3036cb0e3a0fcc9430d4c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214644
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
In a subject app, the 'inheritance' phase of the main unit is reduced
from ~40ms to ~20ms. This improves the pre-main execution after
'CompileScript' from 133ms to 117ms.
Change-Id: I9b426f030c6759274cd84853b99732f43f0968e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214361
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Our understanding improved, and out approach changed significantly.
So, this existing implementation is different enough to be not
very useful anymore. And it gets in my way while doing other changes.
Change-Id: If31c20a0a6f86c01a58d16390a989f77962396b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This improves time to compute suggestions to almost nothing.
Before: <request>: 257, ImportedReferenceContributor: 78, notification: 174
After: <request>: 191, ImportedReferenceContributor: 6, notification: 180
So, almost all time is now in sending the notification.
The cache heap usage is quite small, 4MB for 3246 items.
Change-Id: I754c9f12d6b0a318645d6b20fafdfbbbdf95c5f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214685
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The `>>>` operator wasn't released until 2.14.0, not 2.3.2.
Change-Id: Ief7b7b3982109a290d229a1ede817e66bc10a6c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is more robust than just encoding the string in `r"..."` because
it allows for error messages that contain double quotes.
Change-Id: I90f698f06a8f197ad46e4bcef54deff34c23776b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214661
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
In follow-up CLs I will build on this data structure to do more
sophisticated YAML error message processing, including generation of
existing analyzer error codes from YAML.
Change-Id: If5d22e2ac3d5c123e3700f8d46c327920a941689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214076
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Additionally, fix instantiate-to-bounds in implicit-type-arg type literals in const expressions.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: I6357d25a525bfedfcdd68d4a27f63bdd121f5e07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The tool `pkg/analyzer/tool/diagnostics/generate.dart` is very
particular about the format of documentation it recognizes. This CL
corrects a few minor inconsistencies that were causing it to miss some
documentation.
Change-Id: Iac937666426e987d597323e314f60971c15371be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214421
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The associated `unawaited_futures` lint triggers for expressions
of type `Future?` as well, so we should allow the workaround to
handle such expressions.
This change makes a static function more permissive, and is not expected
to be breaking in any way.
(It does mean that you need Dart 2.15.0 to use the function with
nullable arguments. I've changed the annotation to say `@Since("2.15")`.
That means anyone using a 2.15 SDK should assume that they need a 2.15
SDK to use it, and someone using a 2.14 SDK will not see the argument
as nullable. If anyone uses `@Since` annotations for anything at all.)
Change-Id: Ib2da4b353104cc88a834208a6ebd788ae55b4544
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214406
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This is a reland of 1016bbadde
The broken benchmarks causing the revert were not due to this CL.
TEST=vm/cc/TTS
Original change's description:
> [vm/compiler] Add more checks in TTSes for uninstantiated types.
>
> In certain cases, optimized type testing stubs for uninstantiated types
> compare the instantiation of the type arguments for the type against the
> corresponding instance type arguments. Previously, only an identity
> check was generated, so the instantiation had to match the instance type
> argument exactly.
>
> This CL adds checks for the following cases:
> * The instantiated type argument is dynamic, void, or Object.
> * The instance type argument is Null or Never.
>
> When strong null safety is enabled, we also check that the the instance
> type argument is legacy or non-nullable when the instantiated type
> argument is non-nullable Object or that the instantiated type argument
> is nullable or legacy when the instance type argument is Null.
>
> This CL also adds handling for the case where the instantiated or
> instance type argument is not a Type, which is necessary for safely
> retrieving the type class id and nullability, and allocates some
> additional registers in TTSInternalRegs for storing type arguments. On
> ARM7, this requires pushes/pops around type argument checking, because
> we've run out of registers there.
>
> Fixes https://github.com/dart-lang/sdk/issues/40736
>
> TEST=vm/cc/TTS
>
> Bug: https://github.com/dart-lang/sdk/issues/46920
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
> Change-Id: Ib8498fd2b9593b4abb92111f062ed2fc95a45c16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210681
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Bug: https://github.com/dart-lang/sdk/issues/46920
Change-Id: Id84730b3bb292ea7fdfe9ebd8b1fc6e71c64cf22
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211901
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
[co19] Status files updated
Change-Id: I206e33a31e5c55954f8ac914e0885dc6003afe26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212003
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
In particular, check the two cases where a constructor reference or
function reference may appear in which they must be constant
expressions, but are not in constant contexts:
* default parameter value
* field initializer in a class with at least one generative const
constructor
We also update NodeReplacer to also replace a DefaultParameterElement's
reference to the AST of the default value.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Iea92265d41459b9f79317128e96d80de5069abfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Follow-up to cb7c932f7b
Change-Id: Ie00e7759880bfc80f7b04a79979325d26607f148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214581
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
For a small analyzer library the time to analyze it 100 times,
each time changing that file that we are analyzing, so simulating
typing in this file, goes from 1000 ms to 100 ms; for a bigger
library 2400 vs 800 ms.
For a tiny Flutter hello_world the difference is 100x, 5800 vs 50 ms.
Bug: https://github.com/flutter/flutter-intellij/issues/5761
Change-Id: I15c43f4cd66399788ffe6032c52fb365665de7f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I5aaef20fdd61fd6ac9dc69978111fb680c7f99e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211624
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
A pointer to a single SampleBlockBuffer was being passed in while
building a profile instead of a reference to SampleBlockListProcessor.
This also could lead to a segfault if there were no blocks to process.
TEST=CQ + manual testing in Flutter engine
Change-Id: I1e2903cf718da7b32747553c2ed1efcb78b62c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214441
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
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>