Open iarkh opened 6 years ago
The situation here is similar to the one in #33704, so the remarks I made there apply here as well.
Adjusting the area because it is a compile-time error, and it is the VM that does not emit an error.
With the recent version (2.1.0-dev.8.0) dart throws an error as expected:
test.dart:1:21: Error: Type 'void' can't be used here because it isn't a return type. Try removing 'void' keyword or replace it with 'var', 'final', or a type. typedef F
= Function(X); ^^^^ test.dart:1:21: Error: Type 'void' not found. typedef F = Function(X); ^^^^
The only remaining problem here is that probably the second error message is obsolete: if one error reads that void
type cannot be used here, it looks strange that the second one reads that void
type cannot be found.
Dart SDK Version: 2.0.0-dev.55.0 OS: Windows 10
Sample code below declares a [typedef] with parameter which extends [void]. It causes a lot of compiler errors with dartanalyzer and passes without errors with dart:
I believe both tools should behave in the same way. Dartanalyzer sample output is:
Dart stdout and stderr are empty, no exceptions or warnings there.