-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).improve-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messagestype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
FutureOr<void> foo() => print(""); // print() returns void
The code above produces an error in both analyzer and VM. Analyzer error message is A value of type 'void' can't be returned from the function 'foo' because it has a return type of 'FutureOr<void>'
and VM error is Error: A value of type 'void' can't be returned from a function with return type 'FutureOr<void>'.
This error message is confusing. void
is assignable to FutureOr<void>
, the problem here is that a void
value returned by print()
is used. Please update the error message accordingly.
cc @eernstg
Dart SDK version: 3.7.0-71.0.dev (dev) (Fri Oct 25 17:06:43 2024 -0700) on "windows_x64"
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).improve-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messagestype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug