Skip to content

dart fix not applying for static method rename, parameter changes #51198

@Piinks

Description

@Piinks

Noticed in flutter/flutter#119187

With this transform rule:

- title: "Migrate to 'routeInformationUpdated'"
    date: 2023-01-30
    element:
      uris: [ 'services.dart' ]
      method: 'routeUpdated'
      inClass: 'SystemNavigator'
    changes:
      - kind: 'removeParameter'
        name: 'previousRouteName'
      - kind: 'renameParameter'
        oldName: 'routeName'
        newName: 'location'
      - kind: 'rename'
        newName: 'routeInformationUpdated'

The expectation is that this will be the result:

/// Before, deprecated method
SystemNavigator.routeUpdated(routeName: 'foo', previousRouteName: 'bar');

/// After
SystemNavigator.routeInformationUpdated(location: 'foo');

Instead the result is only a partial transformation:

/// Actual result
SystemNavigator.routeInformationUpdated(routeName: 'foo');

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestdevexp-data-driven-fixesIssues with the analysis server's support for data-driven fixeslegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions