Skip to content

dart test fails with an incorrect message when there are issues compiling package:test #45288

Open
@devoncarew

Description

@devoncarew

When running dart test, if there are issues with the front end compiling package:test, we emit the compilation messages, but then emit misleading messages about adding a dependency on package:test. This project already has a correct dep on test.

See the last two lines of the output below:

dart test       
Precompiling executable... (5.3s)
Failed to precompile test:test:
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:97:8: Error: The method 'MultiHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.
  void add(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:699:8: Context: This is the overridden method ('add').
  void add(String name, Object value,
       ^
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:129:8: Error: The method 'MultiHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
  void set(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:708:8: Context: This is the overridden method ('set').
  void set(String name, Object value,
       ^
Failed to precompile test:test:
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:97:8: Error: The method 'MultiHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.
  void add(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:699:8: Context: This is the overridden method ('add').
  void add(String name, Object value,
       ^
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:129:8: Error: The method 'MultiHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
  void set(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:708:8: Context: This is the overridden method ('set').
  void set(String name, Object value,
       ^
You need to add a dependency on package:test.
Try running `dart pub add test`.

cc @sigurdm, @bkonyi

Metadata

Metadata

Assignees

Labels

area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.dart-cli-testIssues related to the 'dart test' tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions