Commit graph

36610 commits

Author SHA1 Message Date
Konstantin Shcheglov 3d0a6845e4 Rename TypeNameTracker to NamedTypeTracker.
Change-Id: I097f5267d0bbc172f68ec685d35d3cee09312fb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214128
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 14:54:16 +00:00
Konstantin Shcheglov e0518b47cf Rename TypeNameResolver to NamedTypeResolver.
Change-Id: Ifd26abf211be47b3e65482d038eceb966a686fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214127
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 14:53:57 +00:00
Lasse R.H. Nielsen 18f37dd8f3 Add extension name getter on Enum.
We use an extension getter instead of an instance getter because
it doesn't conflict with any potential existing or future enums
which want an element named `name`.
Keeping the namespace for enum elements open is a priority.
We currently only reserve `index` and `values`.

BUG: https://github.com/dart-lang/language/issues/1511

Fixes language issue #1511, which is a long-standing request,
and should replace a number of alternative implementations
which are based on parsing the `toString()`.


This version has two fields on the shared superclass, the index
and private name, and has a separate `toString` for each `enum` class
which hard-codes that enum's class name.

An earlier version had both `"name"` and `"ClassName.name"` as fields
to be able to reuse the same `toString` method on all enum classes,
but that cost too much for JS compiled code.
Even having just `ClassName.` as a field and then combining inside
`toString` requires more code to create the enum instances.
Instead this version hardcodes the `ClassName.` string once
in the `toString` method, which means each enum class has its own
toString (which can *potentially* be tree-shaken then.)

This still tree-shakes slightly worse than the previous implementation
where every enum class had its own `index` and `_name` fields
independent of each other, which could then be tree-shaken independently.
However, the `index` was already made an interface member with the
addition of the `Enum` interface, so code which accesses `.index`
on something of the `Enum` supertype could prevent tree-shaking of
all enum classes' `index` fields.
Likewise any general access to the "name" of an enum would necessarily
do the same for the name.
This CL makes up for some of that by sharing more implementation
between enum classes.

DartVM AOT CodeSize impact: ~0.15% regression on gallery (little less on big g3 app)

TEST= New tests added to enum_test.dart

Change-Id: Id25334e6c987f470f558de3c141d0e3ff542b020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-22 14:20:16 +00:00
Paul Berry 24c20d4844 Lock down FfiCode.type to ErrorType.COMPILE_TIME_ERROR.
Previously, the FfiCode constructor allowed the error type to be
overridden, but no use of that constructor actually took advantage of
it.

Hardcoding the type of all FFI error codes makes the implementation of
error codes more uniform, which helps pave the way for code
generation.

If in the future, we decide that we actually need some FFI error codes
to have different error types than others, we can always add the
functionality back in.

Change-Id: I5061281089aeba0185fd8ebaa08a82482e91f2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214070
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-22 12:31:26 +00:00
Chloe Stefantsova 684e8cf9f7 [cfe] Distinguish between call-site access kind in shown members
Change-Id: Ie893e1b9ef46ccfb3a86393cec4342845af49f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213765
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-09-22 10:13:37 +00:00
Alexander Thomas 63932dc7d3 [testing] Fix logic for detecting invalid named configurations
* Fix regression (https://dart-review.googlesource.com/c/sdk/+/214040).
* Add tests for invalid configurations with and without named configs.
* Add a custom test matrix for testing.

Change-Id: If169571c3163c5f4da1d3d989a2fcff6dc0a7d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214044
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-09-22 09:34:46 +00:00
Konstantin Shcheglov 8aa9716d36 Replace TypeName with NamedType in nnbd_migration/, where possible.
Change-Id: I8031e1f7f0192e211598a806b3ba4244784b6b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:27:37 +00:00
Konstantin Shcheglov 8ecbaa8393 Replace TypeName with NamedType in analysis_server/, where possible.
Change-Id: Ice232aed2b705030861afa115350b1c77aa49d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:26:39 +00:00
Konstantin Shcheglov b8877d1f5a Replace TypeName with NamedType in analyzer_plugin/, where possible.
Change-Id: I979e904fc54fef6dfc42cb999ac72fefb669f462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 01:26:21 +00:00
Konstantin Shcheglov 6fc5d5956d Replace TypeName with NamedType in AstFactory.
Change-Id: If3ef21313321725728fa716c06462138e42435a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 01:26:11 +00:00
Konstantin Shcheglov 056a6cae31 Replace more references to TypeName with NamedType.
Change-Id: I6981aac2ca0d17bd3dd75c37689ef66319214cc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-22 00:34:30 +00:00
Riley Porter 82e8948ddc Add external extension fields, getters, and setters.
CFE transformation to add a function body for external fields,
getters, and setters, routing to the relevant js_util
getProperty and setProperty optimized calls.

Change-Id: Ia3d0f05fda50f20d217c0a67e0fd636bb774000b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213600
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-09-21 22:56:18 +00:00
Konstantin Shcheglov f5c114ad66 Remove AnalysisDriver.onCurrentSessionAboutToBeDiscarded
Change-Id: I283469662c5edab7ec1cf7f9ab37587cd4758211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 21:30:31 +00:00
Konstantin Shcheglov 8495d8b591 Rename FindNode.typeName() to namedType().
Change-Id: Idc0a2ef9cd5bddda345e9a7e603145c7d3ee2a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 21:30:28 +00:00
Konstantin Shcheglov b41ae230a2 Replace many casts to TypeName with NamedType.
Change-Id: I485b7a3e268c59c435f02e3357dc5dcf256e627e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214067
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 20:32:38 +00:00
Paul Berry 201ee847fe Migration: Properly handle awaits of custom future classes.
Bug: https://b.corp.google.com/issues/200651131
Change-Id: Ia06066783a9107848f85bc234b7612a55f54c9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214069
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-21 20:29:07 +00:00
Konstantin Shcheglov dc5eec2c5a Issue 46103. Resolve type arguments of TypeName(s) - there might be expressions.
Bug: https://github.com/dart-lang/sdk/issues/46103
Change-Id: Ia847403c7609f289f3f3f8bd5cd10e221216993f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 17:23:18 +00:00
Konstantin Shcheglov 9220ce35cb Fix cases where TypeImpl.toString() is used.
Instead getDisplayString() should be used.

Change-Id: I1c988bc9d193398aadbb32620e01f11ea3e353d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213900
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 15:16:22 +00:00
Konstantin Shcheglov 0c893bfd7f Rename assertTypeName() to assertNamedType().
Change-Id: I959da4662efccdb1d89fbf13eb23220439e6dd34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213980
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-21 15:00:22 +00:00
Stephen Adams 5c719b3bd3 [dart2js] Simplify message templates
Change-Id: I8e3f33664a3e7944e1b2d6bcf09bebd74c7b826e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214003
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-21 12:45:02 +00:00
Alexander Thomas b3cfd293ad [infra] Allow arm64c on Android configurations
* Fail test.py if an invalid named configuration is used.

Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm64c-try
Change-Id: Ib700511a639ee39fd58441dd6fee8bd6dad8c2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214040
Reviewed-by: William Hesse <whesse@google.com>
2021-09-21 10:15:29 +00:00
Stephen Adams 0071b38172 [dart2js] dart format --fix in kernel/
Change-Id: Iab8c98930c6add208679074c562f129e797af780
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213970
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-21 02:01:08 +00:00
Mayank Patke 35421c5d1a [dart2js] Update MethodTypeInformation to narrow the return type of
_lateReadCheck.

Change-Id: If76a5b34cfd9da9721bfa0d8642b018a4af131dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213901
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-21 01:59:45 +00:00
Stephen Adams 9872fd192e [dart2js] Modernize allocations in js_emitter/
Change-Id: Iecdde5c8940ede24f4ac428a624984a0b2ca4f97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213963
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-09-21 01:05:15 +00:00
Stephen Adams 048dd185c6 [dart2js] Modernize allocations in js_model/
Change-Id: If93776e2f556e8d7adfdbe5e3603f7477e0486f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213902
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-21 00:22:55 +00:00
Konstantin Shcheglov 064a7cca5f Tweak the type check and remove a cast.
Change-Id: I4524e0a52300854a88bb89067e6c9c604308a118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 21:36:29 +00:00
Stephen Adams a666e5a221 [dart2js] dart format --fix in serialization/
Change-Id: I0e14a6fad41721380fbd406104932c7a8011e4ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213960
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 21:28:26 +00:00
Sam Rawlins f12333dfa0 Resolve more cases of .call; correct many cases of PropertyAccess receivers
Fixes https://github.com/dart-lang/sdk/issues/47211

Much of this change is about decision-making based on the _type_ of the
function in a FunctionReference, or the receiver of that function, in the
case of prefixed identifiers or property access.

Previously, there was a rule that only direct references to functions
(top-level, local, and method) could be torn off and type-instantiated.
That rule has been reversed (#1812), so a lot of unraveling has to be
done here.

`e.call<...>` is now legal for _any_ generic function-typed expression
`e`, which certainly may be an expression without a staticElement.
Additionally, `e<...>` is now legal for _any_ generic function-typed
expression `e`.

Because we no longer resolve PropertyAccess piecemeal, we no longer
report UNDEFINED_IDENTIFIER or UNDEFINED_PREFIXED_ELEMENT etc before
deciding to check if a tearoff is being made on a function-typed
element. The unfortunate side-effect here is some redundant
error-reporting. :( I've left TODOs.

Change-Id: I62106332e39d528cbd7cdfa5ec831dc56b394b52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 20:17:35 +00:00
Sam Rawlins 5c83d863ef Delete 3 classes from analyzer's deprecated parser
Change-Id: I8aec6064215969023d23a871e10c1aa22fdc2f7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213848
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 19:16:04 +00:00
Sam Rawlins c260f251a7 Remove redundant imports from compiler
In many files, there is a redundancy in importing

    import 'package:compiler/src/common.dart'
    and
    import 'package:compiler/src/diagnostics/diagnostic_listener.dart'

I chose to remove the latter import.

Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: Ia6c871080bf2d7c637694a4fe5cb1b84e540b789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213851
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 19:14:33 +00:00
Stephen Adams cc73b9001f [dart2js] dart format --fix in inferrer/
Change-Id: I105784a65c1f4c0748bab157522af3bcc2aad066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213862
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 19:06:13 +00:00
Joshua Litt dffb06bca9 [dart2js] Address some feedback in algorithm_state.dart.
Change-Id: I9c96ca7294318d7f28f692791ba5ce9518f18f97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212023
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-09-20 19:03:23 +00:00
Stephen Adams 427af76e0b [dart2js] dart format --fix in js_emitter/
Change-Id: Ib4ba65b922ef687adc355c41b3ae23d337659f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213863
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 18:40:13 +00:00
Konstantin Shcheglov 45bfa70348 Put the path back into file not found exception.
Its absence causes a dartdoc test failure.

Bug: https://github.com/dart-lang/sdk/issues/47220
Bug: https://buganizer.corp.google.com/issues/200468974
Change-Id: I0fe8af902cd9a11abb0102ce4744c57f1738ab5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 18:39:27 +00:00
Stephen Adams 552573ac93 [dart2js] dart format --fix on ir/
Change-Id: Iae34547b8ea7840fdd7b6e5c3b95e8ee4ca3e670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213861
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 18:31:25 +00:00
Stephen Adams 6e3de72138 [dart2js] dart format --fix on js_model/
Change-Id: Id06c441e16c2a0d8df96e9d525ce887f269e4e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213860
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 18:24:03 +00:00
Stephen Adams d4385e620d [dart2js] Modernize allocations in js_backend/
- Use `{}` syntax for Maps and Sets
- Remove type arguments on right side of initializations with same
  type arguments.
- A few cases of replacing conditional code with `??`/`??=`.

Change-Id: I1b58a109b1f8ea8458f37a2de256ffb3dc9956b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213853
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 18:23:23 +00:00
Paul Berry b2347f66ce Fix reporting of CompileTimeErrorCode.PRIVATE_SETTER
The error code text is:

    The setter '{0}' is private and can't be accessed outside of the
    library that declares it.

So when instantiating this error we should only provide a single
argument.  Previously we were providing a second argument that was the
name of the type.

Change-Id: I952dec86f079b9e17e071d37895c3b38c715cf4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-20 17:52:53 +00:00
Paul Berry 3ae5055f75 Translate named placeholders to positional in generation of syntactic_errors.g.dart.
Previously, if a CFE error contained a placeholder (such as
`#string`), that wasn't converted to the equivalent analyzer
placeholder, which meant that analyzer error reporting logic needed to
know whether the error being reported came from the CFE or the
analyzer in order to report the error correctly, otherwise the
placeholder text would just show up verbatim in the analyzer output.

Change-Id: If875de3a1a80048700b0edf458377c5fc87a15d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213281
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 17:51:40 +00:00
Konstantin Shcheglov 4d3f45db2c Issue 47241. Fix FunctionExpressionInvocation of a cascaded getter.
Bug: https://github.com/dart-lang/sdk/issues/47241
Change-Id: I8f6c7e418970f3a696df2561ba3a62cffb8e23a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213843
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 17:36:37 +00:00
Sam Rawlins 08bb058e72 Remove redundant import from _js_interop_checks
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I6fa385eddc76397ce4944674bd548a16755f265d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213850
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2021-09-20 16:58:24 +00:00
Paul Berry 204338d17c Fix reporting of HintCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION
The hint code text is:

    The declaration '{0}' is annotated with 'visibleForOverriding'. As
    '{0}' is not an interface member that could be overriden, the
    annotation is meaningless.

So when instantiating this error we should only provide a single
argument.  Previously we were providing a second argument that was the
name of the annotation; this is unnecessary because the error message
already mentions the annotation name ('visibleForOverriding').

Change-Id: I022af6914668ad6232005237619b3ab9a5d7a589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-20 16:51:51 +00:00
Brian Wilkerson 98d28c08ee Improve the highlight range for non_sized_type_argument
Change-Id: I1c54df8e8f5c167fdb87053cca181cd52ee6f853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213823
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-20 16:50:21 +00:00
Sam Rawlins d6f0e39f30 Remove redundant import from dev_compiler
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: Iab83d15b0f6c5448b75881fcba8c8ea177feab71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213852
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-09-20 16:37:41 +00:00
Brian Wilkerson e061501495 The diagnostic wrong_number_of_type_arguments_function does not have published docs
It was incorrectly marked as having them. Attempting to navigate to docs
opens the correct page but there's no docs to open to so it leaves the
page scrolled to the top.

Change-Id: I862fa215ee59e8aa1200a7e33186e91528b8ef19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213840
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-20 15:54:03 +00:00
Sam Rawlins 9f0c408376 Remove redundant imports from front_end
Very often there were two imports of the same URI, one of which also
had a `show` combinator. I opted to remove the other one.

Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I1263c892f94f0645fda6dee371dfc1fcddcd2344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213846
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 15:33:43 +00:00
Sam Rawlins 8d04e49078 Remove redundant imports
Each of these imports removed is redundant with
'package:kernel/ast.dart'.

Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: Ia9bc08b4ffd863572c84fe8a4fa465d2e8e04f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213845
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 15:25:01 +00:00
Sam Rawlins 51d5c58d6a Remove redundant imports from analyzer
Many of these are a redundancy between
    'package:analyzer/src/generated/source.dart' and
    'package:analyzer/src/generated/source_io.dart'

I chose to remove the latter, for no particular reason.

Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: Ic69b09fd502c978cef9e4d3b8a0ef9acd92d5184
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-20 15:22:51 +00:00
Jens Johansen e4ddc7801a [CFE] Mark 'dart2js/late_from_dill/main' as SemiFuzzFailure (by design)
Change-Id: Ifa53ce1e43737a39841bf185a1288527556d1644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213771
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-09-20 09:23:53 +00:00
Johnni Winther 3fd4283295 [cfe] Remove exports from internal libraries
Change-Id: Ief854e97f5cd3c8a04137ec6682f8193946abcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213770
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-20 08:28:00 +00:00
Brian Wilkerson d45095c4d7 Improve the highlight range for packed_annotation_alignment
Change-Id: I8b526afaa00c185024c180b849fc0b93cdb16098
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213824
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-20 05:18:42 +00:00
Brian Wilkerson 01cf350483 Improve the highlight range for non_positive_array_dimension
Change-Id: Ibd2eabda9adf2489f52fc988c97b5452765cc2a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213822
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-20 05:18:40 +00:00
Stephen Adams 5f7a18b492 [dart2js] dart format --fix in js_backend/
Change-Id: I35f5564601c76ff0c8bb141fa3902484ce8e82bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213842
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-20 01:53:50 +00:00
Sam Rawlins 4ff0cb2ac3 analyzer: Migrate some tests from constant_test to value_test.
In particular:

* integerDivide tests are well-covered in value_test.
* There was not great coverage for logicalShiftRight, so I improved
  coverage in value_test.
* remainder tests are well-covered in value_test.
* shiftLeft tests are well-covered in value_test.
* shiftRight tests are well-covered in value_test.
* times tests are well-covered in value_test.

Change-Id: I4d9e584119dbd9c05ad5deae783429636a0b9218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-19 21:54:30 +00:00
Konstantin Shcheglov 28738dfad0 Store data objects for File/Folder in MemoryResourceProvider.
And by storing the list of child names in a folder we can implement
Folder.getChildren() more efficiently.

Bug: https://github.com/dart-lang/sdk/issues/47220
Change-Id: I893dffd6ada4095b8580ec5d469142478f57f284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-19 20:43:01 +00:00
Brian Wilkerson b1d878fc8f Add a fix for avoid_print that makes the invocation conditional on kDebugMode
Change-Id: I922f8f51d40127032573acadcdb76a37c005f48c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213801
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-18 15:42:43 +00:00
Ahmed Ashour a24d875ff6 ChangeBuilder.writeType to handle nullability of Function
Bug: 29050
Change-Id: I2ec8e0a49c626f75ebd1d21adad5d0d63123c54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-17 22:26:09 +00:00
Anna Gringauze df4671a77a Split expression compiler worker tests
Expression compiler worker tests sometimes reach the timeout limit
on CI machines, split them into two batches.

Closes: https://github.com/dart-lang/sdk/issues/45484
Change-Id: I502de5d768f29be862e593379e3a906ec6c21eb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213734
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2021-09-17 20:28:41 +00:00
pq a1bafa191c stop needless (re)mapping of globs
See: https://github.com/dart-lang/linter/issues/855

Change-Id: I5b07bf77ae5b17c32561d2ec14dd34347866b4eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213733
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-17 19:41:04 +00:00
Johnni Winther 9a97bb58d5 [cfe,dart2js] Add late from dill dart2js test
This tests how the CFE handles loading dills with the dart2js
late lowering.

The currently fails because the fields have changed type and
assignability, as seen from the CFE perspective.

Change-Id: I2229db29144538f0cf5c2ea88c4453c58032d4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213768
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-09-17 19:07:21 +00:00
Stephen Adams 70af0e4c57 [dart2js] Modernize allocations in ssa/
Also:

- fix order of arguments to HBoundsCheck

Change-Id: I4dbcca67dd89f3048a22315d8db2fa862d810774
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213620
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-17 18:47:31 +00:00
Paul Berry 81dda21cd4 Don't supply arguments when reporting IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION.
This hint message doesn't take any arguments.

Change-Id: Idc2546901b3dcbbbb45356628028f1ac08d71c7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213730
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 16:45:51 +00:00
Paul Berry a9873f195f Fix error message text for INVALID_MODIFIER_ON_SETTER.
This error message was previously reported by the analyzer's parser,
which presumably supplied an argument describing the modifier.  It is
now reported by the shared parser, which doesn't supply any additional
information.  As a result, the error message was showing up for the
user as "The modifier '{0}' can't be applied to the body of a setter."
(with a literal `{0}` visible to the user).

Changed the error message text to match what the CFE reports.  There's
no real need for the message to describe the modifier since the error
message location is the modifier itself.

Change-Id: I538d49c1b693fe6cfb190f584bb5c9ab5cd3cf39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213732
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 16:38:39 +00:00
Paul Berry 86b74f399c Don't supply arguments when reporting DUPLICATE_{HIDDEN,SHOWN}_NAME.
These error messages don't take any arguments.

Change-Id: I1818dea02801b3f14f2db0c74841071d8457365a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213728
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 16:37:49 +00:00
Paul Berry 166fa48fed Don't supply arguments when reporting INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY.
This error message doesn't take any arguments.

Change-Id: I12cfe2a079eb3c6f81976e1ce451ce6ab6d0c47a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213731
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 16:17:51 +00:00
Sam Rawlins cf143bb60b Re-enable the unnecessary_imports check
Bug: https://github.com/flutter/flutter/issues/82844
Change-Id: Iaf7017578177952b4871e340b057c442be01bfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200540
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-17 16:11:29 +00:00
Danny Tuppeny b68ccc9a39 [dartdev] Add a "dart debug_adapter" command to run the DAP server from DDS
Change-Id: Icf4442929f848f7f927e84c999f09206e3fd0704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-17 16:09:49 +00:00
Paul Berry 5844340c73 Don't try to supply arguments to GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND error.
The error message text is:
    Generic function types can't be used as type parameter bounds
And the correction message is:
    Try making the free variable in the function type part of the
    larger declaration signature

There are no placeholders in these messages to accept arguments, and
there's really no need for any (since the location of the error is the
offending type), so just remove the argument.

Change-Id: I0ea653d7085782f924c63fbdb0e19ac66f04808a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:56:53 +00:00
Paul Berry eead1f7f5c Don't supply arguments when reporting CONST_DEFERRED_CLASS.
This error message doesn't take any arguments.

Change-Id: I5ff2e43c6d6877189ad8cf7cefded72b4867a309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213727
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:50:51 +00:00
Paul Berry f8b1161496 Fix error_processor_test.dart's use of USE_OF_VOID_RESULT.
The message for this error code doesn't accept any arguments, so
there's no reason for the test to provide any.

Change-Id: I6306cead7865704c9074dd0dc2a1bc1aacaeda16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213724
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:48:51 +00:00
Paul Berry 6f86375f9c Fix error message arguments supplied by TypePropertyResolver.resolve.
Some of the error messages reported by TypePropertyResolver.resolve
require arguments, others don't; this change ensures that we pass
arguments only when they're needed.  This should pave the way for
adding assertions to make sure the proper number of arguments are
supplied when instantiating an error message.

Change-Id: Ic94a4ff7ee2f7845a693b91f8a9231570e0cf4c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:42:49 +00:00
Paul Berry eb7830a22d Fix error reporting in ResolutionVisitor._resolveType.
None of the error codes passed to this method require arguments, so if
this method reports an error, it shouldn't supply any arguments.

Change-Id: Iadcf2652bd46420944cbdffcc2e69415c07f00fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 15:40:49 +00:00
Sam Rawlins 1ba97ac74c Remove unnecessary import in analyzer
Change-Id: Ic029cf3c823f0b226d41e75513f28632bde52194
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213729
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-17 14:52:02 +00:00
Paul Berry 3b7fa6dab3 In NullableDereferenceVerifier, do not supply arguments when reporting INVALID_USE_OF_NULL_VALUE.
INVALID_USE_OF_NULL_VALUE doesn't take any arguments, so we shouldn't
supply any.

Change-Id: I2b78277d754a5d009800927a50cff20c771c162f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213726
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 14:50:39 +00:00
Jens Johansen 211ad9acb1 [CFE] Don't mark procedures as async when not using await
This CL removes async markers where await wasn't used.

In a few cases this also meant the ability to make the procedure not
return a future at all.

Also - at least on the VM with my benchmark run on my PC - returning
new Future.value(whatever) in a non-async procedure is faster than
returning whatever in an async procedure.

TEST=CI and existing tests.

Change-Id: I4ba888313c87de76bb0ca02c19eb1ab45f168a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213480
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-17 11:56:29 +00:00
Paul Berry af18bfacc1 Fix analyzerCode corresponding to CFE error ConstructorWithTypeArguments.
Previously we had identified this error with the analyzer error code
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, but
they're not the same error at all.  As a result, code like this:

    var x = new a.b.c<C>();

would lead to the bogus analyzer error text "The constructor '{0}.{1}'
doesn't have type parameters." (with the placeholders "{0}" and "{1}"
visible to the user).

With this change, the error text is the same as that from the CFE: "A
constructor invocation can't have type arguments after the constructor
name."

Change-Id: Ib69d1ff8f7089e59b71d2dcd9a8ec51edffd94dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213621
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-17 10:48:59 +00:00
Ben Konyi 123950ffa9 [ CLI / VM ] Add support for disabling DDS
Allows for tooling (e.g., DAP) to spawn their own DDS instance without
having to disable the CLI.

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

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Ie9a4832d424edae67f32560399d3b0a6ca9f1dc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213660
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-16 20:31:45 +00:00
Sam Rawlins 797bfe5bb0 analyzer: Support type instantiation of 'call' tearoff of function
Fixes https://github.com/dart-lang/sdk/issues/47212

Change-Id: Id4d5fc47e2e3ae1ef9949a698ba22c697f9e4b14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213539
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-16 19:45:45 +00:00
Joshua Litt a2d1fa1a33 [dart2js] Support serialization with supplied indices.
Change-Id: I830d084f59281b9dff81f33b72002d709f35c16c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212344
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-16 19:33:55 +00:00
Sam Rawlins 1f66977de1 Use static strings from FunctionElement where possible
This improves discovery, refactoring, etc.

I did not change any locations which would have required interpolation,
or tests which refer to a String immediately nearby (in tests).

Change-Id: I8479fd7822713e878e56fdf5ec35969492049333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-16 19:05:55 +00:00
Sam Rawlins 5a4921bd76 Remove unnecessary import from compiler
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I98e103a1af11794927fc1fe6794e69ec655debf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213424
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-09-16 18:03:15 +00:00
Brian Wilkerson 9605ca2980 Fix an inconsistency in terminolgy in the documentation
Change-Id: If3e7d74af72c4d3c4e533d2c3dcd880c4f2b5bf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213622
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-16 17:10:35 +00:00
Ben Konyi c51f885613 [ Debugger ] Allow for setting breakpoints on conditional statements
with simple boolean conditions

Fixes https://github.com/flutter/devtools/issues/3289

TEST=runtime/observatory/tests/service/breakpoint_on_simple_conditions_test.dart

Change-Id: I5ed0b78b4e462615d0d0c7dff1581b38dcf00aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-16 16:12:17 +00:00
Chloe Stefantsova 78266c3464 [cfe] Account for setter/getter access in extension type resolution
Change-Id: Ib35625e39b6f8e741bbc4a16a01851c6d0582213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213346
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-16 16:07:55 +00:00
Chloe Stefantsova cafa530277 [cfe] Add simple resolution rules for shown and hidden members
Change-Id: Ie3abc7201fcfc87940e10c577246f1585328c7ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213500
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-16 14:40:55 +00:00
Johnni Winther 4aa6373724 [cfe] Avoid looking up unneeded operator == for EqualsNull node
Closes #47223

Change-Id: I8ad80c38ed1454a0c6e8088e98cd6db5d7d19930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213540
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-16 10:11:55 +00:00
Johnni Winther 70730ad62f [cfe] Avoid stack overflow on getter/field invocation
Change-Id: Id627378c289708c8bf7fe551ad9b6c512aafe226
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213501
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-16 07:16:44 +00:00
Konstantin Shcheglov c4f4e80fe9 Report HintCode.UNNECESSARY_TYPE_CHECK_TRUE for null safe code.
In legacy code `int v` was implicitly `int|Null v`, so `v is int` could
be useful (although probably should be `v != null` then). In null safe
code, we cannot have `Null`, so we can report a hint.

Change-Id: I60dc0791c6b8346d924fd13b1d2ce3fcceb22d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-16 06:43:07 +00:00
Stephen Adams 63f21ac34c [dart2js] dart format --fix in ssa/
Purely mechanical CL.

Change-Id: I9515670150f3c99b531128e1e3ca71924f2900e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213530
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-16 04:01:35 +00:00
Konstantin Shcheglov 3409b2a0e8 Remove 'featureSet' from TestAnalysisContext.
Change-Id: Ide3eb73562aa70b0daf82d12f66f2001b7a3c735
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213533
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 23:20:05 +00:00
Konstantin Shcheglov 532214b033 Let a part have its own LibraryCycle if requested.
Change-Id: Ic724342040f951cfc670a6daa3e6be08e33d2fc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213531
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 22:55:06 +00:00
Konstantin Shcheglov 7015c192ab Use ResourceProviderMixin in AnalysisOptionsProviderTest.
Change-Id: I2c92ec2f8359c9414c26e146d45bb1dd084df98b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213532
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 22:51:33 +00:00
Konstantin Shcheglov 703dad5685 Compute importedFiles/exportedFiles/partedFiles in more null safe manner.
Change-Id: If36e24114525e209dd6ce8dc2c4200e9d372ee1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213529
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 22:30:24 +00:00
Konstantin Shcheglov 2f75d18626 Prepare to publish analyzer 2.3.0 and _fe_analyzer_shared 26.0.0
Change-Id: I77350acbf48b58cb19e444628643c6743e806eb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213285
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 22:23:34 +00:00
Konstantin Shcheglov 9ecb2d0616 Remove unused members from FileState and AnalysisDriver.
Change-Id: Ie28538f171233d800fa95e66bc7acd24fb6131dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213523
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 21:21:04 +00:00
Konstantin Shcheglov a3f338e456 Fix MakeReturnTypeNullable for possible null type.
Saw in crash log:

StateError: Bad state: No type: void
at ExpressionExtension.typeOrThrow	(extensions.dart:89)
at MakeReturnTypeNullable.compute	(make_return_type_nullable.dart:55)
Change-Id: Id985d7a2bb26fe9e494f3a36dc0b15196c6de463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213412
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 20:59:58 +00:00
Stephen Adams ff617b9505 [dart2js] Fix bug in load elimination with try-catch-finally
1. Make unwrapException pure. This allows it to be removed if the
exception is unused, and ensures that the catch does not unnecessarily
invalidate locations. This is helpful since, by itself, this change
causes some test failures due to the load elimination bug (#47166).

2. Invalidate locations on entry to catch and finally blocks. This is
a conservative fix for #47166.

Bug: 47166
Change-Id: If3b4113b538978095d59814c16bd8375bbd70696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213414
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-09-15 19:34:23 +00:00
Konstantin Shcheglov 5a83de3313 Remove unused declarations in LibraryCycle.
Change-Id: I80ea79353a2caff6ad15b2c1d4936ec063c5b584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213521
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-15 18:51:02 +00:00
Mayank Patke 9cf14f417d [dart2js] Move pkg/compiler/test/kernel/goldens_test testcases to
pkg/front_end/testcases/dart2js.

Change-Id: Iede8f9b03119dab4ee2a3ed6498d6a7e4e19a6a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212260
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-15 18:34:14 +00:00
Sam Rawlins 2bd0759ec9 Move several local resolvers to be lazy fields on ResolverVisitor
This code is simpler and conceivably reduces memory usage.

Change-Id: Ic20a3ec05b60c557d829fc52a79589d6445e062d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213413
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-15 17:24:10 +00:00