Skip to content

[wildcards] produce a warning on late wildcard variables. #55905

@pq

Description

@pq

Examples:

Initializing expression is essentially dead code:

int f() => throw StateError('unreachable');

void g() {
  late int _ = f();
  late final int _ = f();
}

Variable declaration is unnecessary (can't be accessed or assigned to):

void f() {
  late int _;
  late final int _;
}

Discussion: dart-lang/language#3798

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondevexp-warningIssues with the analyzer's Warning codesfeature-wildcard-variablesImplementation of the wildcard variables featurelegacy-area-analyzerUse area-devexp instead.type-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