sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Analyzer error message became less informative

Open sgrekhov opened this issue 6 years ago • 0 comments

void foo({int i}, {String j}) {}
void bar({int i}, [String j]) {}

If to run the code above in analyzer 1.19.1, then output is

[error] Cannot have multiple groups of named parameters in a single parameter list (test.dart, line 47, col 19)
[error] Cannot have both positional and named parameters in a single parameter list (test.dart, line 48, col 19)

Now run the same code in dartanalyzer version 2.7.0-dev.1.0. Output is

  error - Expected to find ')'. - test.dart:47:17 - expected_token
  error - Expected to find ')'. - test.dart:48:17 - expected_token

Analyzer 1.x error messages are much more informative than 2.x ones

sgrekhov avatar Nov 27 '19 04:11 sgrekhov