Skip to content

[linter] Warn about reference without assignment #60155

@exoad

Description

@exoad

It can be troublesome if the following syntax is produced due to functions being treated as first class:

void someFunction() {

}

void main() {
 someFunction;
}

The line someFunction is referenced without being called, which can produce bugs if it was intended to be called or assigned.

There should be a linter warning to push for the programmer to either call it with .call()/() or assign it to a variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions