Commit Graph

13417 Commits

Author SHA1 Message Date
Sam Rawlins c219974ecf analyzer: Deprecate Diagnostic.errorCode in favor of diagnosticCode
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I2c7d64a81bc214e64fbc3ac95cf1fe2363a6ebd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433242
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-06-09 09:22:22 -07:00
Brian Wilkerson 3502a35cf7 Add a context message to not_a_type diagnostics
Fixes https://github.com/dart-lang/sdk/issues/55947

Change-Id: I38b838c59d3c2983ac26efda7a5ab20f3d29485e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433362
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-06 14:23:32 -07:00
FMorschel f0ad03cabf [DAS] Adds fixes for implicit_this_reference_in_initializer
Fixes: https://github.com/dart-lang/sdk/issues/60729
Change-Id: Ie2ee6ff84062b749a9a8385a3140f9bc35760df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429081
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-06-05 16:17:39 -07:00
Sam Rawlins 903d77cc82 analyzer: Rename ErrorListener classes to DiagnosticListener
Work towards https://github.com/dart-lang/sdk/issues/60635

I tried to keep this minimal but still sensible:

* Rename AnalysisErrorListener and all subtypes to use 'Diagnostic'.
* Rename all instantiations of such classes if they previously
  contained the word 'error'.
* Rename `RecordingDiagnosticListener.errors` to `.diagnostics`.
* Rename some _testing_ instance members that had the word 'error'
  to instead use 'diagnostic'.

Change-Id: I3948e27ba28ac2494092e04f4e1d201a20cc1135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433004
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-05 14:05:40 -07:00
Brian Wilkerson 45722db629 Add documentation for dot shorthand diagnostics
Please let me know if there are other diagnostics that I missed.

Change-Id: I87d29f62bcd1dad519c34212a2aa41d4422f1002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431949
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Amanda Fitch <afitch@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-06-05 10:58:09 -07:00
Sam Rawlins e76fcdad1a analyzer: Remove TODO that is DONE
Change-Id: I15a85d31b797d99d68c94b3c0fe433c18d9effbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432905
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-05 09:43:32 -07:00
Sam Rawlins b2beba242d analyzer: Convert callers of InheritanceManager3 to use InterfaceElement API
This includes all callers in analysis_server and analyzer_plugin. And
callers of `getOverridden4`.

Change-Id: Ia744f6c7260b445c6b1e02d3cf5515aaa9c7feeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432962
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-06-04 16:30:22 -07:00
Brian Wilkerson 1a7617e015 Improve the message for non_exhaustive_switch diagnostics
Fixes https://github.com/dart-lang/sdk/issues/60690

Change-Id: I1431d646a53c39b738369493b6a234df440dc2f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-06-04 15:17:19 -07:00
Sam Rawlins 47f7c4fb87 analyzer: expose canBeConst and computeConstantValue as public API
Work towards https://github.com/dart-lang/sdk/issues/50986

These utilities are used by a handful of lint rules, and the analysis
server, which makes me think they could be offered as public API.

Change-Id: I12415c2b86ca6fb96b03def4a304da73c6fb4cae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430300
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-04 11:02:17 -07:00
Konstantin Shcheglov 147ba501d7 Elements. Print ConstructorElementImpl references in text expectations.
Change-Id: I090dc6f9471dae969480caeba0204401dbf280e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432724
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-03 14:08:39 -07:00
Konstantin Shcheglov d116d50416 Elements. Add reference to FieldElementImpl2, write it.
Change-Id: Ia5f4c01aa46571c0a835f7e6408cd1af17fd75e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432781
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-03 13:26:29 -07:00
Sam Rawlins 31f8f4b522 analyzer: Make various AnalysisRule classes and their dependencies public
This is a big CL; no code is really "changed." We basically move 3
components into the public API, which can all be reviewed concisely
in the `api.txt` file.

* The AnalysisRule classes: `AbstractAnalysisRule` (which is good to
  make public as a lot of the public API is specified and documented
  here), `AnalysisRule`, `MultiAnalysisRule`.
* The Pubspec classes, available for linting pubspec files:
  `PubspecDependency`, `PubspecDependencyList`, `PubspecEntry`,
  `PubspecEnvironment`, `PubspecGitRepo`, `PubspecHost`, `PubspecNode`,
  `PubspecNodeList`, `PubspecVisitor`.
* The `RuleVisitorRegistry` class. This class is needed by analysis
  rule authors, and is part of the public API of AnalysisRule.

Change-Id: Ib1803180de9469f4ff39cf1778f96787f5f74b14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-06-03 11:09:32 -07:00
Konstantin Shcheglov a10ce29c08 Elements. Add reference to ConstructorElementImpl2, write it.
Change-Id: I40ff802e9c78b2d74c19769da8339a947d23d7f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432540
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-06-03 08:57:59 -07:00
Jens Johansen b246cad216 [parser] Change NullValue usage
This gets rid of (what is described in commented code as)
InstantiatedTypeWithArgumentsTest, Subtype1TestCacheLookup, BoolTest.

Running this through the benchmarker like this:

```
out/ReleaseX64/dart-sdk/bin/dart pkg/front_end/tool/benchmarker.dart \
  --snapshot=pkg/analysis_server/bin/server.aot.1 \
  --snapshot=pkg/analysis_server/bin/server.aot.2 \
  --arguments="--disable-file-byte-store" \
  --arguments="--train-using" \
  --arguments="pkg/front_end/lib/"
```

(there `server.aot.1` is without this CL and `server.aot.2` is with)
I get:

```
msec task-clock:u: -0.9614% +/- 0.3557% (-78.23 +/- 28.95) (8136.80 -> 8058.57)
cycles:u: -1.0257% +/- 0.3626% (-348283560.66 +/- 123129577.69) (33955507948.94 -> 33607224388.28)
instructions:u: -1.0595% +/- 0.0662% (-479117043.74 +/- 29935955.93) (45220681554.68 -> 44741564510.94)
seconds time elapsed: -0.9548% +/- 0.3540% (-0.08 +/- 0.03) (8.15 -> 8.07)
seconds user: -1.0649% +/- 0.4031% (-0.08 +/- 0.03) (7.80 -> 7.72)
Scavenge(   new space) goes from 130 to 129
Notice combined GC time goes from 2613 ms to 2608 ms (notice only 1 run each).
```

`StackImpl.pop` as reported by `perf report --no-children` goes from
0.81% to 0.34% (and I'm unsure why the apparent change seen as a whole
is quite a bit bigger).

Change-Id: Ife36da11215e0c8aa706d945f0ee5018ad03ab91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-06-03 04:58:51 -07:00
Konstantin Shcheglov 018ad19e3e Elements. Make LibraryFragment not Annotatable.
Change-Id: I17e0a952b513cfdce81f8404d625f723f6dad95b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-02 16:28:22 -07:00
Konstantin Shcheglov c008be6c4a Elements. Remove FragmentImpl.name, pass name2 into constructors.
Change-Id: I2ef1a470de20ebc61b1e1178453cb609320ddd15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432462
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-02 16:07:16 -07:00
Konstantin Shcheglov 91ae0bfbcf Analyzer DATA_VERSION++
We need to make it different than in https://dart-review.googlesource.com/c/sdk/+/432462

Related to https://dart-review.googlesource.com/c/sdk/+/432161

Change-Id: I56b5935e8fb9e46fc69657ecbe007c19404c10f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-06-02 15:27:40 -07:00
Konstantin Shcheglov 9fc86d963c Elements. Store MetadataImpl in ElementDirectiveImpl.
Change-Id: Id2fcb0a343f69a92762bba350f715730e3e1e499
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432321
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-02 11:31:17 -07:00
Sam Rawlins a5520d07cb analyzer: Expand BlazeWorkspacePackage.isInTestDirectory to include 'testing'
This changed definition is required for google3, in order to support
using `WorkspacePackage.isInTestDirectory` over the `inTestDir`
extension getter.

Then remove linter's export of the `inTestDir` extension method, and
instead rely on WorkspacePackage in lint rules.

Change-Id: I81fc6a27ca8f19f71a8b915edb3968d5d43262ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431943
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-06-02 11:17:53 -07:00
Konstantin Shcheglov ef7e045bfd Elements. Remove metadata3, store MetadataImpl directly.
This CL continues https://dart-review.googlesource.com/c/sdk/+/430261

Change-Id: I4f717dc25f84571e6f86a470e6ddfcf452928682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-06-02 11:14:41 -07:00
Konstantin Shcheglov 73a85ec195 Elements. Deprecate FragmentImpl.name
Next I will remove it completely.
And instead require `name2` as the constructor formal parameter.

Change-Id: Ib4afac3266fe36a7299d60a8b6d87c99349dd64c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-06-02 10:23:24 -07:00
Sam Rawlins 28fc6346eb analyzer: Move RuleContext and RuleContextUnit to public API
Change-Id: I9cca5ee27e623bfa5b878bb0277f5e12e84a745b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-30 15:42:10 -07:00
Konstantin Shcheglov 63aa736da2 Elements. Add reference to MethodElementImpl, write it.
Change-Id: Iedfa3cb01749e527012e24a72539d591a3a0afbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431940
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-30 14:42:03 -07:00
Konstantin Shcheglov e724547892 Elements. Deprecate Annotatable.metadata2, use 'metadata' instead.
Change-Id: Ic4a7d8f19cb1793031951aadeb340e5dadf4744c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430261
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-30 11:09:40 -07:00
FMorschel f18bd99230 [DAS] Fixes comment references for enum constants
Fixes: https://github.com/dart-lang/sdk/issues/60760
Change-Id: I1a6dc74f1265ac4195f772a3e0374856008cbc6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-30 10:04:32 -07:00
Konstantin Shcheglov c98a91f182 Elements. Rename Element2Extension.metadata to metadataAnnotations.
In a separate CL I'd like to deprecate Annotatable.metadata2, and
add `metadata` instead, so this extension method would be hidden.

Change-Id: I8258d5a0d1bd8443a0cfca3b438b3d5ae9d40bb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431941
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-30 07:55:43 -07:00
Konstantin Shcheglov 09dc185bd5 Elements. Use combineSignatureTypes() for inheritance inference.
When we use it, we already have a method declared, it is just that
its types are not specified. OTOH, combineSignatures() creates
a new sythetic fragment / element.

Change-Id: I5f735c1c09ade12c12294c3a6fd6894ba706eac0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-29 14:57:59 -07:00
Kallen Tu 009a6194b3 [analysis_server] Dot shorthands: Call hierarchy changes and tests.
Added work and tests needed for the call hierarchy to handle dot shorthands.

The element locator needed to be updated for the call hierarchy to work, so I updated that too.

Unit tests passing.

Bug: https://github.com/dart-lang/sdk/issues/59836
Change-Id: Id61e6071c5ff008300f7bd25f762a14f22e47595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431701
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-29 13:35:13 -07:00
Sam Rawlins 41ac971d8a analyzer: rename Lint*Context classes
For the analyzer plugin APIs, these classes should not have the word
'Lint' in them, as they are used for all analysis rules, whether they
report lints or warnings.

* LinterContext                    -> RuleContext
* LinterContextWithParsedResults   -> RuleContextWithParsedResults
* LinterContextWithResolvedResults -> RuleContextWithResolvedResults
* LintRuleUnitContext              -> RuleUnitContext

I'm open to better names for these. Some of these suffer from a
chain-of-nouns name (a "RuleUnitContext" is a Context for a Unit for
a Rule). So we could go with "UnitContextForRule" and "ContextForRule"
or other ideas like that.

Only RuleContext and RuleUnitContext will be public API.

Change-Id: I5550736beaba7e39b36e7b5584ca6d023aa4d02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-29 11:49:29 -07:00
Sam Rawlins b085dd53f4 analyzer: Simplify some FileAnalysis usage
ErrorVerifier no longer uses it.

ImportsTracking can be set at creation-time, like other fields, and be
final.

Change-Id: Iac86d571faaeb4419ea54289f48e755a7a8f8a4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-29 09:13:50 -07:00
Konstantin Shcheglov 31607cc56a Elements. Write more ElementImpl as references, not as fragments.
Change-Id: Id41267ca30bb04a79156d106b87bdc08f0566673
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431781
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-29 08:56:09 -07:00
Konstantin Shcheglov 676df8b258 Elements. Remove PrefixElementImpl.
For now, we have a not nice looking way to write / read Element(s). Most
of the elements are stored as their first fragment, and then asked for
elements. I start with PrefixElementImpl2 to stop doing this, and switch
to writing actual element reference. When we are done with all elements,
it will become nice again.

Change-Id: Ia18c2ab516ae06dc0da0b1ab022f217bf9a7400d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431702
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-28 13:56:00 -07:00
Sam Rawlins eba91c5045 analyzer: Move RuleState into the public API
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I32e1d9b6dbb0a6ef91569ae65100365f775ec0f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-28 13:28:26 -07:00
Konstantin Shcheglov 34c5794fff Elements. Make FragmentOrMember implement Fragment.
I few references to `Fragment` were converted to `FragmentImpl` because
it was a convenient time to do.

We added throwing implementations of `Fragment` methods to
`PrefixElementImpl` and `Member` temporarily. We remove
`PrefixElementImpl` completely in the next CL, and eventually `Member`
also will stop implementing `Fragment`, and will implement only
`Element`. But for now it would be a too big change to me to do at once.

Change-Id: I9cf9034a9c45e9baee6ab7421d7ba4d50b6c45c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431622
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-28 12:55:42 -07:00
Konstantin Shcheglov 9d22935063 Elements. Rename ElementOrMember to FragmentOrMember.
And a few related renames in bundle writer / reader.

Change-Id: Ica8aef55d37987c0895176989337ab7c992a1687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-28 12:43:41 -07:00
Konstantin Shcheglov b117e10703 Elements. Remove InterfaceFragmentImpl.instantiateImpl()
Change-Id: I245cb954a12fa7c777855066423b83a1d6008586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431681
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-28 12:40:32 -07:00
Konstantin Shcheglov 5af6310f9c Elements. Use named formal parameters for FragmentImpl constructors.
Change-Id: Iad91dbb30563803e4330e24169e930223c99c2b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431660
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-28 12:33:21 -07:00
Konstantin Shcheglov cde11c1005 CQ. Make a couple of methods return void, remove unawaited() for them.
Change-Id: Icc8e916c4f6fd42d6a604544e893626b97cb5e73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431621
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-28 12:32:30 -07:00
Konstantin Shcheglov 2b5b551cfb Fine. Record InstanceElement.fields/getters/setters access.
Change-Id: I111c048b9a8e9a1e8aad60d2eab68c64eacf9398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431362
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-28 09:31:54 -07:00
Konstantin Shcheglov bfc8faabb8 CodeGen. Document GenerateNodeProperty. #2
Change-Id: I1559e18a4f14a4bec999a1263de54e67d662ec86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431323
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-28 09:17:39 -07:00
Paul Berry 525b67a9fe Enable discarded_futures lint in analyzer and _fe_analyzer_shared.
Several call sites intentionally discard a future; these call sites
have been wrapped with `unawaited()` (which is the standard way to
suppress the lint).

Turning on this lint uncovered several tests that should have been
async; these tests have been fixed.

Change-Id: I66e0f6bf7a05946e8d460ce9b5581837ce067870
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2025-05-28 08:52:15 -07:00
Konstantin Shcheglov 012d84a821 Fine. Record requesting the whole interface.
We give the interface its own ID to track its changes.

We also stop collecting requirements of a summary bundle _after_
computing library manifests for it, because any data that we put into
library manifests depends on what we requested while computing it,
not much different than the summary / elements themselves. Specifically,
interfaces for classes have `map` of all class members, and it
depends on the interfaces of superclasses. And we ask for interfaces
of classes only when computing library manifests, somehow we avoided
doing this while linking libraries.

test_dependency_class_interface_addMethod would not work without
these changes.

Change-Id: I14858bab48ff2ada8df32b8440b8f18eb743d061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-27 13:00:13 -07:00
Kallen Tu 89552236ff [analyzer] Dot shorthands: Infer type parameters in constructor tearoffs.
This CL fixes co19/LanguageFeatures/Static-access-shorthand
/semantics_A05_t01.dart.

While working on this, I realized the static type was wrong and we weren't doing any inference for the constructor references so I updated the logic.

Unit tests passing, language test expectations are actually better than before and that particular co19 test passing.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: I7437079c33640f53f48a4445890fadfebc9ec158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430561
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-27 11:44:00 -07:00
Konstantin Shcheglov 33daa43c86 CodeGen. Document GenerateNodeProperty.
Change-Id: I4e89beb032451cbd067d4314a030ad664b0d780d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-27 10:31:22 -07:00
Konstantin Shcheglov 77dd4fb3ea Fine. Remove library self-dependency from 'instances'.
We already re-compute the library element when its API signature
changes, and re-analyze the library when any of its files changes.

Change-Id: I400096d7a94a8d3c12866c36994e6f2f324bf614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-27 10:31:20 -07:00
Konstantin Shcheglov 4a64532ace Fine. Match type parameters of InstanceItem(s).
Change-Id: I5588df2ae3e336139b2a9839674eb5097d0d9a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431180
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-27 10:22:29 -07:00
Konstantin Shcheglov f3a4e5bc54 Fine. Record InstanceElement.methods access.
Change-Id: I6451b6d3f1bed1624f3d9e3c8e0549615b716678
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430940
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-27 10:06:59 -07:00
Kallen Tu 03515b472e [analyzer] Dot shorthands: Update indexing.
Adds implementation for dot shorthand invocations, property accesses and constructors in indexing and added search tests.

Unit tests passing for index and search.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: I2ee3ddbabb7f8ee0ead6538906a9a55f54bf20a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430563
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-27 10:06:22 -07:00
Konstantin Shcheglov e3fe1c36f3 Issue 60791. Don't add elements without names to exported references.
Bug: https://github.com/dart-lang/sdk/issues/60791
Change-Id: I1b83c16dbcfa5ba8b4371606d643efc4a1193733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431140
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-27 08:52:41 -07:00
Chloe Stefantsova 6fa858cfe8 Enable 'getter-setter-error' flag in 3.9
TEST=existing

Change-Id: Ic4a5735adda7cf8ef1565b9356ca277d9b62b064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430720
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-26 08:08:31 -07:00