sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[CFE] Adjust error message in case of record type

Open sgrekhov opened this issue 1 year ago • 1 comments

Consider the following code

void foo((int,) r) {}

main() {
  foo((1)); // Error: The argument type 'int' can't be assigned to the parameter type '(int)'.
}

CFE produces an error Error: The argument type 'int' can't be assigned to the parameter type '(int)'.. But the type of the parameter here is (int,) not (int)

Dart SDK version: 3.4.0-edge.148d5ac76d53537d808ec8a8a45f38ff88d57528 (main) (Sun Jan 28 18:15:40 2024 +0000) on "linux_x64"

sgrekhov avatar Jan 29 '24 12:01 sgrekhov

See also https://github.com/dart-lang/sdk/issues/60290, which has relevant discussion on it.

bwilkerson avatar Jun 04 '25 21:06 bwilkerson