Skip to content

The documentation of the lint parameter_assignments seems to need updates #7048

@eernstg

Description

@eernstg

Page URL

https://dart.dev/tools/linter-rules/parameter_assignments

Page source

No response

Describe the problem

The documentation at https://dart.dev/tools/linter-rules/parameter_assignments seems to have several elements that weren't updated when null safety was introduced.

For example, badFunction contains a null-aware assignment to the parameter optional, but the type of this parameter is non-nullable (which will give rise to a warning on that assignment). Also, this assignment will never have an effect because optional is never null, which also detracts from the value of the example. Also, the default value is specified using : which has been replaced by = already several versions ago.

Similar issues exist with other examples on this page.

Expected fix

The code should be updated to take null safety into account such that each good example has no diagnostics and each bad example has just the diagnostic which is being documented on this page.

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from.page-issueReported in a reader-filed concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions