Skip to content

Analyzer, require 10.1.0, fix deprecations in dependency_graph.dart#182507

Merged
scheglov merged 1 commit intoflutter:masterfrom
scheglov:analyzer-upgrade-packages-fix-deprecations-in-preview-dependency-graph
Feb 18, 2026
Merged

Analyzer, require 10.1.0, fix deprecations in dependency_graph.dart#182507
scheglov merged 1 commit intoflutter:masterfrom
scheglov:analyzer-upgrade-packages-fix-deprecations-in-preview-dependency-graph

Conversation

@scheglov
Copy link
Contributor

@scheglov scheglov commented Feb 17, 2026

In analyzer 10.x.y we deprecated returnType and want clients to switch to typeName, to support primary constructors language feature.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 17, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the analyzer package to version 10.1.0 and other related dependencies. It also updates the code in dependency_graph.dart to address deprecations from the new analyzer version. However, I've found two critical issues in dependency_graph.dart that will likely cause compile-time errors. Please see my comments for details and suggestions.

}
} else if (_currentConstructor != null && !hasRequiredParams(_currentConstructor!.parameters)) {
final returnType = _currentConstructor!.returnType as SimpleIdentifier;
final SimpleIdentifier returnType = _currentConstructor!.typeName!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The type of _currentConstructor!.typeName! is NamedType, not SimpleIdentifier. This will cause a compile-time error. You can fix this by either using final to let type inference work, or by using the correct type NamedType. Using final is more concise.

      final returnType = _currentConstructor!.typeName!;

column: column,
packageName: packageName,
functionName: '${parentClass.name}.${_currentMethod!.name}',
functionName: '${parentClass.namePart.typeName}.${_currentMethod!.name}',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The parentClass variable is a ClassDeclaration, which does not have a namePart property. This appears to be a typo and will cause a compile-time error. It seems the intention was to use parentClass.name as it was before this change.

              functionName: '${parentClass.name}.${_currentMethod!.name}',

@scheglov scheglov force-pushed the analyzer-upgrade-packages-fix-deprecations-in-preview-dependency-graph branch from 9fcba4a to cce060f Compare February 17, 2026 18:41
@scheglov scheglov force-pushed the analyzer-upgrade-packages-fix-deprecations-in-preview-dependency-graph branch from cce060f to 367e3fb Compare February 17, 2026 20:43
@scheglov scheglov requested a review from Piinks February 17, 2026 21:43
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scheglov scheglov added this pull request to the merge queue Feb 18, 2026
Merged via the queue into flutter:master with commit 294aa14 Feb 18, 2026
148 checks passed
@scheglov scheglov deleted the analyzer-upgrade-packages-fix-deprecations-in-preview-dependency-graph branch February 18, 2026 08:01
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2026
@jmagman jmagman mentioned this pull request Feb 18, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 18, 2026
…11060)

Manual roll requested by [email protected]

flutter/flutter@6e4a481...c023e5b

2026-02-18 [email protected] [web] Pass form validation errors to screen readers via aria-description (flutter/flutter#180556)
2026-02-18 [email protected] Roll Packages from f83926f to 59f905c (10 revisions) (flutter/flutter#182547)
2026-02-18 [email protected] flutter_tools: Copy vendored frameworks from plugin podspecs in ios/macos-framework builds (flutter/flutter#180135)
2026-02-18 [email protected] Marks Windows framework_tests_misc_leak_tracking to be unflaky (flutter/flutter#182534)
2026-02-18 [email protected] Allow TabBar to receive a TabBarScrollController (flutter/flutter#180389)
2026-02-18 [email protected] Clean up cross imports in single_child_scroll_view_test.dart, decorated_sliver_test.dart, draggable_scrollable_sheet_test.dart (flutter/flutter#181613)
2026-02-18 [email protected] Roll Fuchsia Linux SDK from mcN42vw48OPH3JDNm... to Ihau0pUz3u5ajw42u... (flutter/flutter#182530)
2026-02-18 [email protected] Analyzer, require 10.1.0, fix deprecations in dependency_graph.dart (flutter/flutter#182507)
2026-02-17 [email protected] Refactor: Remove material from actions test (flutter/flutter#181702)
2026-02-17 [email protected] [a11y] RangeSlider  mouse interaction should change keyboard focus (flutter/flutter#182185)
2026-02-17 [email protected] Remove more getters from userMessages class (flutter/flutter#182166)
2026-02-17 [email protected] Implement getUniformMatX and getUniformMatXArray functionality on web (flutter/flutter#182249)
2026-02-17 [email protected] Do not wait until dispose before removing replaced/popped page (flutter/flutter#182315)
2026-02-17 [email protected] Add contentTextStyle support to SimpleDialog (flutter/flutter#178824)
2026-02-17 [email protected] Filter error messages from `emulator -list-avds` output (flutter/flutter#180802)
2026-02-17 [email protected] [Reland] Cupertino cross imports (flutter/flutter#182416)
2026-02-17 [email protected] Roll Packages from 09104b0 to f83926f (1 revision) (flutter/flutter#182504)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
…lutter#182507)

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

In analyzer 10.x.y we deprecated `returnType` and want clients to switch
to `typeName`, to support primary constructors language feature.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Feb 27, 2026
…lutter#182507)

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

In analyzer 10.x.y we deprecated `returnType` and want clients to switch
to `typeName`, to support primary constructors language feature.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants