Skip to content

No analyzer strong mode error for void sync* and async* functions #32192

Closed
@sgrekhov

Description

@sgrekhov

Consider the following code

void h() sync* { }

main() {
  h();
}

Alanyzer in nostrong mode produces warning
warning - Functions marked 'sync*' must have a return type assignable to 'Iterable'
I'm expecting an error in a strong mode but there is, surprisingly, no issues!

The same is true for async* functions

void h() async* { }

main() {
  h();
}

warning - Functions marked 'async*' must have a return type assignable to 'Stream'
in a nostrong mode and no issues in a strong one

Tested on dartanalyzer version 2.0.0-dev.26.0 on Windows

Metadata

Metadata

Assignees

Labels

dart-model-analyzer-specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions