Commit graph

83726 commits

Author SHA1 Message Date
Konstantin Shcheglov 22a8295295 Report INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR instead of INSTANTIATE_ENUM when enhanced-enums.
Change-Id: I634b3e50641b2b696b4d9e164266b43fdc72f137
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-01 23:58:45 +00:00
Paul Berry 0d5eec26f1 Stop storing contextual information on ArgumentList nodes.
Instead of using InferenceContext.getContext and
InferenceContext.setType to associate type inference information with
ArgumentList nodes, we pass the contextual information around on the
stack.  This should be more efficient (since it avoids a map lookup),
and it should make the code easier to reason about (since it makes the
flow of data in the type inference process more explicit).

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: I331792cf6d7289a27fc71edfc6af33cd1af5288c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230942
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-01 23:54:05 +00:00
Paul Berry 6117501cd6 Streamline context handling for collection literals.
Rather than do two passes over each collection literal (one to push
contexts down and a second pass to resolve), we pass the contexts down
on the stack during a single resolve pass.

I decided to create an extra data structure to hold the context
information (so I only had one thing to pass around on the stack
rather than four).  The extra allocation will carry a small
performance cost.  However, I was able to reduce the number of passes
over the collection literal from two to one, replace a chain of
is-tests with a virtual dispatch, and eliminate a double-dispatch in
some cases, so hopefully the benefit of those improvements will more
than offset the cost.

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: I949c2c5ef99fc3395de3d67eaa8f326b7af5b158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-01 23:42:45 +00:00
Mayank Patke 99d49dca95 [dart2js] Remove dependency on package:expect in RTI-need emission
tests.

Change-Id: I8be03f22c3b7195a2d10050c622415379c8b7563
Bug: #48087
Fixes: #48087
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230883
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-02-01 23:42:25 +00:00
Mayank Patke 0163ef0d3b [dart2js] Remove dependency on package:expect in RTI-need unit tests.
Bug: #48087
Change-Id: I9729abea021945c66671f74805c4878aa04ade2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227903
Reviewed-by: Stephen Adams <sra@google.com>
2022-02-01 23:42:25 +00:00
Ben Konyi f8ec0f405b [ DDS ] Fix LateInitializationError in memory_profile.dart
Fixes https://github.com/flutter/flutter/issues/97588

Change-Id: I67f7bf20464bea105fa12fae99b6e4912899a1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231180
Reviewed-by: Jason Simmons <jsimmons@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-01 23:16:15 +00:00
Nicholas Shahan 3af828a347 [ddc] Inline and remove cast from unsafeCast()
Avoids an extra function call and removes a casts that are
always expected to succeed from the compiled code in the
sdk async library. The motivating changes are introduced in
https://dart-review.googlesource.com/c/sdk/+/230240.

Change-Id: I4da07a54f025ee4e2d0a5a0b4fd4ce9c7e765454
Issue: https://github.com/dart-lang/sdk/issues/48225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230884
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-02-01 23:09:05 +00:00
Konstantin Shcheglov af598f9d25 Report NON_ABSTRACT_CLASS_HAS_ENUM_SUPERINTERFACE.
Change-Id: Iec3daeba6b069c80e01baf4bc070059209d1ac4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231045
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-01 23:00:25 +00:00
Nicholas Shahan ae4529a450 [ddc] Fix literal hex values
Change-Id: I3f5a0f5de5ac365e5a99dcedc9f4d87b32ebf87f
Issue: https://github.com/dart-lang/language/issues/2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230900
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-02-01 22:59:15 +00:00
Aske Simon Christensen 8df763f266 Prepare for sharing TFA and patch files between the VM and dart2wasm.
The VM patch files contain many annotations that guide the TFA and the
VM compilation pipeline. Most of these are not relevant to dart2wasm,
and having the TFA look at these when running inside dart2wasm leads to
sub-optimal, and sometimes even unsound, results.

In order to enable sharing of patch files between the VM and dart2wasm,
the annotation parser is given a target flag to control which
annotations it should recognize and how to parse them. The annotation
parser thus becomes an abstraction layer between the concrete
annotations in the patch files and the parsed annotations that the TFA
sees.

Additionally, external members used by dart2wasm don't always have
external names. To support this, the signature shaker must skip all
external members, not just the ones with an external name. This makes no
difference for the VM, since all of its external members either have an
external name or are implemented in a patch file, making them no longer
external.

TEST=ci + upcoming dart2wasm CL
Change-Id: Id425dd1ccc5560721034ae83c8cdc1593801a4e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231102
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-02-01 21:08:46 +00:00
Kevin Moore 534608fc66 CHANGELOG: Move entry for HTTP header redirect changes to 2.16.0
Related to commits

- master branch 57db739be0
- stable (2.16.0) branch f5bb0b33f5

Change-Id: Iad8d84600c870e4b819fc6c62fbb4d6861a575de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231161
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2022-02-01 19:48:13 +00:00
Konstantin Shcheglov c995c02293 Resolve field formal parameters in enum constructors.
Change-Id: Ib0e22e75c5b8c9d1f578d856624fe509a3cbaaf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231050
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-01 19:09:45 +00:00
Konstantin Shcheglov dcc1b8bc18 Report NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR.
Change-Id: I1a087a3b554d5d5439d43b0798d14a46310f1bfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231048
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-01 18:18:55 +00:00
Konstantin Shcheglov 17d2a0b755 Report SUPER_IN_ENUM_CONSTRUCTOR.
Change-Id: I403b51eed9a0f685e56433a2b567b8a38a95e15b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231049
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-01 18:18:35 +00:00
Ryan Macnak 6f9289ca30 [vm, compiler] Avoid false positive in assertion for eliminated write barrier.
This adjusts RISC-V to match the other architectures in checking only the generational barrier.

TEST=fuzzer
Change-Id: I86965bb2caaae27aa9770769f392cffc8edb6eb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231046
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-01 17:17:05 +00:00
Alexander Markov e4942db83e [vm/compiler] Avoid speculative conversion in ffi Pointer.asTypedList
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that
there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr
representation (uint32) and then the value is passed to a
StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr
representation (int32). As a result, a speculative uint32->int32
IntConverter instruction is inserted by SelectRepresentations pass.
AOT doesn't support deoptimization so code generation crashes after
retrying without speculative inlining.

This change fixes the type incompatibility by loading value with
LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr).

TEST=ffi/regress_flutter97301_test
Fixes https://github.com/flutter/flutter/issues/97301

Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-02-01 16:49:56 +00:00
Paul Berry 410442716d If a try block terminates, don't consider the contents of the finally block to be dead code.
Fixes #48258.

Bug: https://github.com/dart-lang/sdk/issues/48258
Change-Id: Icf88c659f3258a723970d89882b58c75f8eff6d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231043
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-01 13:32:36 +00:00
Sigurd Meldgaard 0e67d987a1 Revert "Remove the pub top-level"
This reverts commit 872ffa85c2.

Reason for revert: flutter needs fixes:
https://github.com/flutter/engine/pull/31181
https://github.com/flutter/flutter/pull/97575


Original change's description:
> Remove the pub top-level
>
> The old pub toplevel interface is still reachable via
>
> ```
>  $ dart __deprecated_pub
> ```
>
> That is what `flutter pub` is using.
>
> Part of https://github.com/dart-lang/sdk/issues/46100
>
> Bug: https://github.com/dart-lang/pub/issues/3292
> Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Michael Thomsen <mit@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: Ida7ae463a78ece7ff9e5aef3fc2ef984a4ac1b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231081
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2022-02-01 12:03:05 +00:00
William Hesse 3e6c900d4b [infra] Remove uses of dart2js, dartanalyzer, and pub from debian package creation
Bug: https://github.com/dart-lang/sdk/issues/46100
Change-Id: I91883bc78aa9d524932e588184bc8ff874d28d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231080
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2022-02-01 11:41:47 +00:00
Jake Macdonald 984ec03a80 Add support for operator functions, fix a few other small things
- Fixes mostly just include outputting raw names instead of identifiers where we don't want prefixing to happen.

Change-Id: I99c349fd742be2b027290ed02daea57002f152e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231041
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-01 06:51:25 +00:00
Joshua Litt 69bc43a531 [dart2js] Statically type unnecessary dynamic type.
Change-Id: Ib188257cb2d218beaabc66851f12fa18850c0969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230824
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-01 01:52:24 +00:00
Nicholas Shahan b47e1ed823 [dart2js] Fix literal hex values
Change-Id: I61eda2633d3ab4310c502ab8232c8e3057e476a4
Issue: https://github.com/dart-lang/language/issues/2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230901
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-02-01 01:24:46 +00:00
Kenzie Schmoll 55052c0203 Update DevTools to version 2.10.0
Change-Id: I21f6f3dfa7ab19e4fd24e7e235894d47f9da4b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230957
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
2022-02-01 00:52:24 +00:00
Polina bb81a1c1a0 Make dominator nullable.
TEST="tested with the added test 'root-dominator-is-null'"

Bug: https://github.com/flutter/devtools/issues/3025
Change-Id: Ifd6f926e3ecd486d383b03e8b81289310a653bb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230882
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
2022-01-31 21:26:14 +00:00
Konstantin Shcheglov 7b2e9d147f Support for mixins in enums.
Change-Id: I75f23c358ddc5ea0a801447d16f7f037cb0cfd28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230945
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-31 19:07:24 +00:00
Konstantin Shcheglov 1b16157413 Switch AbstractCompletionDriverTest to PubPackageAnalysisServerTest.
Change-Id: I39e14c746b1b50af12508e6b30785cdd97920c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-31 18:25:54 +00:00
Konstantin Shcheglov 4227d6a6ab Extract tests for diagnostics from mixin resolution test.
It was probably one of the first tests of this resolution approach,
and so it lingered in all-in-one-place, even though we decided to
put diagnostics in separate files.

Change-Id: Ic98e3fbdd13b2b41cdc037a8a664833ed63b98de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-31 18:04:04 +00:00
Konstantin Shcheglov 556b178032 Tests for getter/setter in enum.
Change-Id: I083a6fa507d62a9957e211fe937cfc6413aae321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230944
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-31 18:02:34 +00:00
Konstantin Shcheglov 972455663d Run tests for completion in FieldFormalParameter with both protocols.
Change-Id: I0e26e602c5b5fa9e85878cea4a62323e38d6ba91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-31 17:31:54 +00:00
Ivan Inozemtsev d7e3fadacd Revert "[vm] Disable longjmp() wrapper in exceptional flow in TSAN until g3 issue is fixed"
This reverts commit 8d412e80e1.

Reason for revert: b/209838275#comment53

TEST=ci

Original change's description:
> [vm] Disable longjmp() wrapper in exceptional flow in TSAN until g3 issue is fixed
>
> Issue b/209838275
>
> TEST=ci
>
> Change-Id: Ie0a2e6f68a0c4f855dfd367dd3dd0a37053be479
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222760
> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iab202ddbd54060f609096b71f8ef83da53249d40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231005
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-01-31 15:49:54 +00:00
Jens Johansen 7771ed34cf [CFE] Fix crash in expression compilation caused by having dill builders in source builders scope
This should fix https://github.com/flutter/flutter/issues/97500
and the reproducable part of https://github.com/flutter/devtools/issues/3599

Change-Id: I16b45e4cc8074e0b0a62ae3220d91ae1424bacf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231004
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 15:34:24 +00:00
Jens Johansen 5896462f77 [CFE] Reproduction of expression crash when starting DevTools
Change-Id: I27df2c0d594f19b7a0e051341f756589f589c4e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231003
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 14:33:14 +00:00
Jens Johansen 3bdbdacdcf [CFE] Mark weak/general/supported_libraries/main as SemiFuzzFailure
Change-Id: I115a0a1d29b807ca0bce6e7285f9fdcdd13d36c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231001
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 14:08:44 +00:00
Johnni Winther 2b1caabee6 [cfe] Don't create concrete forwarding stubs for invalid implementations
Creation of concrete forwarding stubs didn't take into account that an
override might add additional optional parameters making the overridden
member an invalid implementation for the override. This lead to a crash
when trying to compute the super parameter type for the additional
parameters.

Closes https://github.com/dart-lang/sdk/issues/48242

Change-Id: Ie46859d8de328a31eacf7905bb429b0bba61447f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230663
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-01-31 12:03:58 +00:00
Chloe Stefantsova 5f0433afcf [cfe] Report more errors on forbidden enum constructor calls
This CL also adds support for redirecting enum factories.

Part of https://github.com/dart-lang/sdk/issues/47453

Change-Id: Idd16598316a52ac6122a47f4c12f82ab5750d8f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230661
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-01-31 11:45:04 +00:00
Jens Johansen a066e2c83e [parser] Don't be overly aggressive when parsing 'on' in 'try'
Fixes https://github.com/dart-lang/sdk/issues/47541

Change-Id: Idb25f86801b14f75fe7bc06e5496c6fdd2cbe971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 09:09:35 +00:00
Konstantin Shcheglov c28e52c95e Add ExtensionElement.getField(name)
We already have `get fields`, and it seems that for consistency
we should also have `getField()`.

Change-Id: Id2684eaecf2e77377a63c53271301e5d9b652918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-29 17:46:44 +00:00
Konstantin Shcheglov 5c771bd40b Always use 'withNullability: true' in ResolvedAstPrinter.
Change-Id: I65583b6ece8e4a175348672b45c8e548c1c5ffc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230921
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-29 17:37:14 +00:00
Alexander Aprelev 65178de9d2 [infra] Describe how to download large isolate artifacts(core dumps)
File browser web interface might fail to download large files, so one needs
to use cas tool to download those.

Change-Id: I8053860f9ba443dc481319e5574ecd6d41baf8f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-01-29 06:21:23 +00:00
Konstantin Shcheglov 86383dd1af Build interfaces for enums.
Change-Id: I2e73761f46ac37d7bef6902575de031c9f401f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230880
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-29 03:00:22 +00:00
Konstantin Shcheglov 31885cd7e9 Run SuperFormalParameter completion tests with both protocols.
Change-Id: I0cc230731b5ca9bbf6a2b32a921f64d6b717e25f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230881
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-29 02:25:53 +00:00
Paul Berry 9057e2c532 Fix type inference of annotations that refer to constructors.
Previously we were skipping the donwards inference step.  This CL
refactors the downwards inference logic from
instance_creation_expression_resolver.dart so that it can be re-used
for annotations.

Fixes #48201.

Bug: https://github.com/dart-lang/sdk/issues/48201
Change-Id: Ia1b7939cdd350bab9bd019a14a1cf40fb61199ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-01-29 01:33:32 +00:00
Stephen Adams 5a291a28e7 [dart2js] Avoid using 'at' as a minified instance method name.
This CL fixes one part of #48118 by no longer accidentally calling
String.prototype.at.

- Update the list of names that should not be used for minified instance
  method names.
- Expand comment.
- Add a script in tools for finding all the names from within a browser.



Bug: 48118
Change-Id: Iac41bd707d7b447a998d0d94a8b37576dc7d1493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-29 01:03:52 +00:00
Sigmund Cherem b1b9378f6b [ddc]: fix worker_test to run in windows
Change-Id: I882654acf1cdf67cec64efa9c4fdb3ecaba83b50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230826
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-29 00:45:22 +00:00
Riley Porter 9fff4351cf [js_util] Fix lib status files
Change-Id: I946631781508a4364060edc6cab4e9d7e8f69ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230885
Auto-Submit: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-01-29 00:13:12 +00:00
Paul Berry f37dda4640 Fix instance member lookup fallback for static property lookup
When a static property lookup fails, the analyzer's error recovery
logic tries to fall back on looking up an instance member.  An
unfortunate consequence of this is that the looked-up member may have
a type that refers to unbound type parameters.  For example:

    class C<T> {
      List<T> t = [];
    }
    var x = C.t; // (1)

Although the line at (1) has an error, the analyzer continues to
analyze it assuming the reference to `t` is valid, producing a static
type for `x` of `List<T>`.  But this isn't a valid type because `T`
has no meaning outside the context of the definition of class C.

To avoid unbound type parameters leaking outside the class, we do an
"instantiate to bounds" operation at the time of the error recovery;
for this example that results in a type `List<dynamic>` instead of
`List<T>`.

Change-Id: I763bf32d16345b0a1a6f9f6893e78a138e85c8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-01-29 00:03:22 +00:00
Joshua Litt 5bf2e76329 [dart2js] Cleanup dead code.
Change-Id: I640dc4da677ab3ba4644985aa790625aae36283a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230827
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-01-28 23:51:19 +00:00
Stephen Adams b4f0b58cb2 [dart2js] HStringify can generally throw but some uses are pure.
This is something I noticed when 'gardening': HStringify can throw but
the node was using the default 'canThrow' which returns 'false'. This
has the potential for bad codegen, though I am not aware of an instance
of it happening.

This CL makes the default for `HStringify.canThrow` be `true`.

Stringification for primitive types is pure, so this is added as an
optimization. There are a few improvements from this, including removing
an unused stringification.


Change-Id: I9285d91ec906fb544f8793944578b7e3feb8a634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230221
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-01-28 23:31:32 +00:00
Riley Porter 150b51e3dc [js_util] Add implicit downcasts to js_util methods
Add dynamic to JS foreign function calls to get implicit
downcast to T, which will cause more accurate type errors
for DDC and dart2js with -O2. Checks will be omitted
with dart2js and -O3.

Bug: #47832
Change-Id: Ie85faf47d58d748b068bc7e902a17a99292f02e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230823
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2022-01-28 22:28:52 +00:00
Konstantin Shcheglov 88b1f42637 Resolve field/super formal parameters for completion.
Change-Id: I855ed4838111212096b7f86dac96b1027acdd676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230825
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-28 21:25:52 +00:00