Skip to content

strict_top_level_inference is triggered for wildcard variables #60136

Closed
@ngoc-quoc-huynh

Description

@ngoc-quoc-huynh

The new strict_top_level_inference rule triggers a lint warning when using a wildcard (_) as a function parameter. I'm not sure if this is intentional, but I would expect the wildcard to be exempt since its type is irrelevant and cannot be used.

void foo() {
    const ValueChanged<int> onChange = _onChange;
}

// Lint warning 
void _onChange(_) => print('I do not need the value.');

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestdevexp-warningIssues with the analyzer's Warning codeslegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions