Commit Graph

3501 Commits

Author SHA1 Message Date
Brian Wilkerson 450c1962d0 Make members a subtype of element rather than fragment
Change-Id: I4fce1d1a3a63b79dcfc1b61903e5dcabd7771bfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388066
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-10-04 18:42:33 +00:00
Parker Lougheed a409a1c07d [analyzer/linter] Use shared enumeration for lint names
This helps to avoid any accidental mispellings, enables find usages, and potentially makes future renames easier.

The primary goal is to make future work in https://github.com/dart-lang/sdk/issues/56835 easier.

Change-Id: I684630a4d6cb145031de0dabc221f247246ea00c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-10-03 21:36:49 +00:00
Konstantin Shcheglov 4fe2944776 Parts. Consider 'part' of 'part of lib.name' as an error.
Maybe? https://github.com/dart-lang/co19/issues/2907

Change-Id: If64ba74bf8d3ad3f5e1b926f19705ae469c76a5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-10-02 18:16:14 +00:00
Sam Rawlins f84a81002c linter rules: tidy up test support
Just little things:

* Convert the class AnalysisOptionsFileConfig and it's `toContent`
  method into a single function.
* Convert the class PubspecYamlFileConfig and it's `toContent` method
  into a single function.
* Privatize ExpectedDiagnostic fields `diagnosticMatcher`, `offset`,
  `length`, `messageContains`,
  ExpectedError field `codes`,
  ExpectedLint field `lintName`,
  LintRuleTest field `collectionIncludedPaths`,
  _ContextResolutionTest field `sdkRoot`.
* Privatize `writeTestPackageAnalysisOptionsFile` and
  `writeTestPackagePubspecYamlFile`
* Start doc comments with a single-sentence summary (https://dart.dev/effective-dart/documentation#do-start-doc-comments-with-a-single-sentence-summary and https://dart.dev/effective-dart/documentation#do-separate-the-first-sentence-of-a-doc-comment-into-its-own-paragraph)
* Document with third-person verbs (https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs)

Change-Id: I7d584810cd339f8184fe14c3151b55988bf2cfff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-09-26 14:33:04 +00:00
Konstantin Shcheglov b07eb3b325 Parts. Report PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER in parts.
This also moves the target to be the import prefix, not the declaration.
This is how the specification describes it, and scope lookup works.

Change-Id: Ic0f60a6b57bd8760589b1a91be8885fafb5c90c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-09-24 21:45:12 +00:00
Konstantin Shcheglov 09e3261127 Elements. Write FormalParameterElementImpl.
Change-Id: Icb61913fe0a195271e507c61e500a3f2be0ec689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-23 16:05:32 +00:00
Konstantin Shcheglov 6e0f03fd5e Elements. Print new elements for resolved AST.
Change-Id: I629151c61fafea61b4fe8cd1ff94a828d2a99754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-19 12:12:28 +00:00
Konstantin Shcheglov 35bbfb2314 Parts. Move changes to prepare for removing deprecated 'enclosingElement'.
Change-Id: I79804b8907627e54d993a905c62ffc36e6d348b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-12 20:33:20 +00:00
Johnni Winther cd236ece98 [parser] Add enclosingDeclarationName to beginMethod
This adds the enclosingDeclarationName to the beginMethod of the
parser listener.

This enables the removal BuilderFactory.currentTypeParameterScopeBuilder.

Change-Id: Ie2bec9432c20b8bdbd62a14e8a65c272179d4698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383182
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-09-05 07:40:09 +00:00
Fedor Shcheglov f3413b0ebf Remove tests that use import augment directive.
Change-Id: I9626aa0219aaff2884a8cd2e5fffee4dee5784ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383100
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-04 18:49:50 +00:00
Konstantin Shcheglov 8de1422a0e Parts. Deprecate Element.enclosingElement, use enclosingElement3.
Change-Id: Iadc4ed02d4bda3b882e65dc6f4d263a6a938e0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-01 18:50:29 +00:00
Johnni Winther bf3c716f36 [cfe] Create FunctionTypeParameterBuilder for function types
This changes the BodyBuilder to create FunctionTypeParameter instead
of FormalParameterBuilder for "parameters" in function types. This
avoids the creation of unnecessary VariableDeclaration nodes
function types.

The types of these VariableDeclarations where created before the type
variable scope was completed, introducing an artificial dependency on
the pending nullability computation.

Change-Id: Ie1203fa4c78a27f3e7a0dfad16725cbbde24a6a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381143
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-08-22 08:23:05 +00:00
Sam Rawlins 5ce0cc571c analyzer: correct wording of "always null" and "never null" warning
Fixes https://github.com/dart-lang/sdk/issues/53670

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I5e890e990d128754b8d9a89e8e940c756779a602
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-08-19 16:14:28 +00:00
Konstantin Shcheglov 37540885ec Parts. Compress '::@fragment::libraryUri' into '::<fragment>'.
Example:
-      base: package:test/a.dart::@fragment::package:test/a.dart::@class::A::@constructor::new
+      base: package:test/a.dart::<fragment>::@class::A::@constructor::new
Change-Id: I85cc401f8b4c39eeadf295c89bab7872c80143f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378023
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-07-31 16:56:40 +00:00
Konstantin Shcheglov 9fefc36afa Parts. Use '@fragment' instead of '@unit', start compressing.
Change-Id: I9fd054d78c303fa1853bec9673f64deb620afd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-07-30 17:19:29 +00:00
Sam Rawlins f4423e61ec Remove 4 old HintCodes, all replaced with WarningCodes
* UNNECESSARY_CAST
* UNUSED_ELEMENT
* UNUSED_ELEMENT_PARAMETER
* UNUSED_LOCAL_VARIABLE

Work towards https://github.com/dart-lang/sdk/issues/50796

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I15c74e5ebc626f7e513c04013aa2f81b36ca39a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377762
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-07-29 18:55:49 +00:00
Sam Rawlins c93e385975 analyzer: Improve support for ignoring all static warnings in a file
Fixes https://github.com/dart-lang/sdk/issues/55331

Currently (I suppose accidentally), you can ignore all warnings with
'type=static_warning'. But that is not good UX; instead we can just
support 'type=hint', 'type=lint', and 'type=warning'. (Hints are on
their way out, but that is unrelated.)

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I82ea15a0601cb7bb962bd907406d83410dbd43f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377760
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-07-29 17:46:09 +00:00
Konstantin Shcheglov b7d3cdb5a7 Parts. Add 'libraryOrAugmentationElement', use as 'CompilationUnitElement.enclosingElement' for now.
Also, add separate 'get library'.

Medium term we will switch to `enclosingElement3` that will return
the unit element that includes this unit element (or null for defining).

Long term, with the new model, these will be fragments.

Change-Id: I999c99df610ad5792dbb3307c55e2b7577afacc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377271
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-07-24 23:07:35 +00:00
Konstantin Shcheglov 5dc0334b48 Parts. Use longer, more detailed reference strings.
Change-Id: I2fad120784b5c02f65af75f4c6c1a65fbf7c7b77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/377261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-07-23 18:46:19 +00:00
Konstantin Shcheglov 86e5463c37 Parts. Support for parsing and (not) reporting errors.
Change-Id: I4f352b7cc0c782eba96cd63e5b4a605657fd5c5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-07-15 20:43:17 +00:00
Jens Johansen 5d352e6627 [parser] Add begin and/or end to endElseStatement, endIfStatement, endThenStatement, endTryStatement
Change-Id: I27b7241665042a7fae6dc4c7d4192da9ce141b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-19 06:12:00 +00:00
Sam Rawlins 4f5dc5603f analyzer: Deprecate dead properties on Comment
Work towards https://github.com/dart-lang/sdk/issues/56038

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If7ae2738fec598f16756c524b6bd6c258ee5609e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 18:27:25 +00:00
Konstantin Shcheglov 617f99700a Issue 52363. Check that the current name scope is LocalScope.
PatternAssignment is a strange expression that syntactcally can have
declared variables inside.

Bug: https://github.com/dart-lang/sdk/issues/52363
Change-Id: Id6132be26581112941b7b4828c8e232143ed59b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369505
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-06-04 16:47:14 +00:00
Jens Johansen 81f5879ca0 [parser] Rename firstToken to beginToken in beginSwitchCase/endSwitchCases
This makes it more consistent with other listener calls.

Change-Id: Iae98ae4c37078c15ea785faef1cb21b2ea85bb48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-04 08:23:36 +00:00
Sam Rawlins 030b79dc1c analyzer: Report bare 'super' expression as ExpressionFunctionBody
Fixes https://github.com/dart-lang/sdk/issues/55525

Change-Id: Id6e1321d093b4b77f0504748e931db8f460c1b45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369122
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-03 17:24:26 +00:00
Konstantin Shcheglov 1b9cc28879 CQ. Make FileSource API, move to lib/source.
Change-Id: I981d3f0904917ada322ca06448f03ff33ae1f095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-06-03 00:36:59 +00:00
Konstantin Shcheglov f69ac337ca CQ. Stop using File.createSource() in analyzer/.
This mixes layers, which I believe one of the ways that cause large
library cycles.

Change-Id: Ie1cf991bcd40b19127a6ade7efc5ad5fd69d0018
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368942
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-31 20:06:28 +00:00
pq 643b9ae8f7 remove unused parser error codes
The error codes are not being generated and the mapping to `EXTRANEOUS_MODIFIER` in tests is unnecessary.

This logic is likely a hold over from when the analyzer had it’s own parser with temporary conversion logic to align it with fasta. With only one parser, these bits are stale and should be safe to remove.


Change-Id: I5b29f0081953c61771b313025595910eef055c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367540
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 15:08:18 +00:00
pq cf65fa73dd remove AstBuilder.enableNonNullable
Change-Id: Ifb7e049115297a34ed95a974b0a1e71540b54ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367148
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-20 20:08:25 +00:00
Konstantin Shcheglov 52999d58b6 Augment. Parse 'augment' for typedef.
Change-Id: I3d8c583bd5a20ded9e8004574314f0d3a076d649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364940
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-30 15:51:25 +00:00
Konstantin Shcheglov 4432585051 Augment. Store 'augmentationTargetAny', check type in 'augmentationTarget'.
So, we can distinguish "no target" from "invalid target".

If we augment a setter, and there is no target, we also probe getters
(and methods, constructors). Which theoretically is not the same as
augmenting e.g. a class with a mixin - they live in different names.
Not sure. Maybe don't look for `name` when `name=`?
The difference is that we will report "No augmentation target" vs
"It is wrong when a setter augments a method".

Change-Id: Ibee84b2d039cf16824cb367fefdcda72b99f54bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364603
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-04-26 19:25:23 +00:00
Jens Johansen fc67d31862 [parser] Listener calls should not be on the next (unrelated) token
When the parser sends events to the listener some events has a pair of
parameters, `beginToken` and `endToken`. Most of these are constructed
in such a way that the `beginToken` is the first token and the
`endToken` is the last token in that construct. This is for instance the
case with `endClassDeclaration`.
It was, however, not the case for `endMetadata` where `endToken` instead
was the next token *not* in the metadata.

In this CL I've found a changed the following to point to the last token
in the construct instead of the next token not in the construct and
renamed the parameter where it made sense:

* `endAssert` --- and renamed `semicolonToken` (which only pointed to
  a semicolon for statements) to `endToken`.
* `endAwaitExpression`
* `endConstLiteral` --- and renamed `token` to `endToken`
* `endConstructorReference`
* `endFieldInitializer` --- and renamed `token` to `endToken`
* `endForIn`
* `endForInBody` --- and renamed `token` to `endToken`
* `endForStatement`
* `endForStatementBody` --- and renamed `token` to `endToken`
* `endFunctionExpression` --- and renamed `token` to `endToken`
* `endInitializer` --- and renamed `token` to `endToken`
* `endInitializers`
* `endInvalidAwaitExpression`
* `endMetadata`
* `endSwitchCase`
* `endTopLevelDeclaration` --- and renamed `nextToken` to `endToken`
* `endWhileStatement`
* `endWhileStatementBody` --- and renamed `token` to `endToken`
* `handleNoConstructorReferenceContinuationAfterTypeArguments`

In the few places in listeners where these values were used I've mostly
updated to do e.g. `endToken.text!` to retain the current behavior.

Change-Id: I25495e160d1eec5c75bcf1313b512cd04bcb1533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364322
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-04-26 06:59:23 +00:00
Konstantin Shcheglov e90a6a7e61 Augment. Move primaryConstructor, representation, typeErasure into AugmentedExtensionTypeElement.
Change-Id: I7683c84ab4cbef22d559564f3cf4839a394b05d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-23 22:41:33 +00:00
Sam Rawlins 0895727c59 analyzer: allow trailing whitespace in ignore comments
Fixes https://github.com/dart-lang/sdk/issues/54247

The main piece of this CL is a rewrite of the `ignoredElements`
extension on CommentToken. This was a private extension getter, but
is made public now for two reasons: first is to reference it in tests,
and second is to make it available for a new lint rule in an upcoming
CL.

The new implementation drops all use of RegExp in order to more
precisely track when we may be at the end of a list of diagnostic
names and/or types. So the functional change here is that a diagnostic
name or type followed by whitespace instead of a comma marks the end
of the list. Any characters following that whitespace are not parsed,
as they are considered freeform comment text. While the new
implementation parses a comment code-unit-by-code-unit, it is still
a rather concise impl.

* Rename DiagnosticName and DiagnosticType to IgnoredDiagnosticName
  and IgnoredDiagnosticType; these names make more sense to me,
  specifically when they are used outside of the ignore_info.dart
  file.
* I introduce a new test file, ignore_info_test, to capture these
  various parsing particulars, that aren't specifically concerned with
  matching an ignore comment with a diagnostic. A few test cases from
  ErrorSuppressionTest are moved over here.
* A number of String (well, int, technically) helper functions are
  moved to analyzer, along with their tests.

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

Change-Id: Ife08d448a4e03b8a55b183d88a3ea8d07812fbdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-22 16:53:42 +00:00
Konstantin Shcheglov b65887829e Augment. Report enums without constants after parsing.
Change-Id: I5af7fbc398bfa4ad2463fb9f37cef3757dd42151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-22 15:22:32 +00:00
Konstantin Shcheglov 4bb644ce3e Augment. Parse enum constant augmentations, allow just ';' before methods.
I was unable to update the parser to avoid requirement for ';' at all.
Ideally we should be able to parse:
```
enum E {
  void foo()
}
```

Change-Id: I7edba99454b965407c3fb402642933b3d8d6bb7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363106
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-17 15:26:31 +00:00
Konstantin Shcheglov 0ef8f05c6c Fix 'unnecessary_final' in analyzer/.
But don't enable it yet, pending https://github.com/dart-lang/linter/issues/4938

Change-Id: I42df6e5c2699b08d729518c0565165d81e07ad3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-16 21:46:15 +00:00
Konstantin Shcheglov 9844985cc4 Augment. Support for augmenting extensions, element model.
Change-Id: I2eaa5e14d0148710a15052cfee8dbf71d8e33237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-15 22:30:45 +00:00
Chloe Stefantsova 8aa400bf5f [analyzer][cfe] Share the implementation of the Variance class
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ie406b59baf3efdeaac577f5181320b28c5076068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361781
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-04-10 13:08:55 +00:00
Konstantin Shcheglov ad345495ad Augment. Parse 'augment' for enum declaration.
Change-Id: I8360b86d675e423fe1a4e8d501b29a2b30f20fee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360781
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-04-03 15:59:49 +00:00
Konstantin Shcheglov c5f876b7aa Augment. Use ExtensionOnClause in ExtensionDeclaration, make it optional.
Change-Id: I696ffd0b8e8f3bf9017b583d480313ec7c7753f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-02 16:12:00 +00:00
Konstantin Shcheglov 031a855539 Augment. Parse 'augment' for extension declaration.
Change-Id: I5670e75c9d99be894d571bf9dc4d0d67df41ef82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-27 17:45:49 +00:00
Abitofevrything e9dd95a10b Reland "Preserve non-synthetic function types when resolving invocations of functions with type parameters"
This is a reland of commit 7ad5a57bf2

Original change's description:
> Preserve non-synthetic function types when resolving invocations of functions with type parameters
>
>
> Update existing tests to require existing parameter elements
>
>
> Add tests for staticParameterElement in generic functions
>
> R=leafp@google.com
>
> Bug: https://dartbug.com/54669
> Change-Id: Ie899f58df56ad1a6b49426ca4d7f4e611975b284
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350920
> Auto-Submit: Mylo Fawcett <mylo.fawcett@gmail.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Bug: https://dartbug.com/54669
Change-Id: I6fc02655d651d6525a9507af29d5c47a337cce74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355320
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-12 16:37:15 +00:00
Konstantin Shcheglov d042edfea0 Revert "Issue 54468. Use (int, int) as backing storage for EnumSet, up to 60 elements."
This reverts commit 492e40713d.

Reason for revert: too expensive

Original change's description:
> Issue 54468. Use (int, int) as backing storage for EnumSet, up to 60 elements.
>
> Bug: https://github.com/dart-lang/sdk/issues/54468
> Change-Id: I04a221526dcc7e380e7e9c84f8bb8b2fed52f4eb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355823
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

Bug: https://github.com/dart-lang/sdk/issues/54468
Change-Id: I9f8b6755c8f8fce4e23dcb8533ef680eb8516dba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355885
Auto-Submit: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-03-05 23:52:39 +00:00
Konstantin Shcheglov 492e40713d Issue 54468. Use (int, int) as backing storage for EnumSet, up to 60 elements.
Bug: https://github.com/dart-lang/sdk/issues/54468
Change-Id: I04a221526dcc7e380e7e9c84f8bb8b2fed52f4eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-05 22:03:37 +00:00
Konstantin Shcheglov 9cafa46290 CQ. Use Feature.foo.enableString instead of EnableString.foo
Less internal, and more consistent to search for feature references.

Change-Id: I9f74d12bc2e22317443f7ba5867369266334373f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-03-04 21:09:54 +00:00
Konstantin Shcheglov add929e5bc Legacy. Remove interfaceTypeStar()
Change-Id: I28eb26086ad4c48d00f5d337436cdc755f4cc962
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-04 21:00:39 +00:00
Konstantin Shcheglov ebb5c7d666 Augment. Use nullable PropertyAccessorElement.variable2
As much as I don't like the scale of changes, there is no valid variable in these cases. So, we express this explicitly, without trying to pretend that there is on. Or crashing as we did without this CL.

Change-Id: I74cef1d3d9d3cba6985d83b98be361cca09170f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355300
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-04 19:28:28 +00:00
Konstantin Shcheglov 77278218a2 Legacy. Remove intStar.
Change-Id: Ibbdbfbaed4145004ec9f234f936b36bb7697083a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355306
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-04 19:00:36 +00:00
Konstantin Shcheglov 2ac973c6df Legacy. Remove objectStar.
Change-Id: I24f3d2305fe295ed68462ad548d6244497f8b6ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355303
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-01 00:08:39 +00:00