Skip to content

False Negative "extra_positional_arguments" #60172

@RohitSaily

Description

@RohitSaily

Dart SDK version: 3.7.0-323.2.beta (beta) (Tue Jan 28 07:06:50 2025 -0800) on "macos_x64"

This issue is closely related to #60174 and so it may be productive to fix them together.

The following main.dart as the sole file in a folder opened in VSCode.

@A([''], ['']) void main()
	{}
extension type const A(List<String> strings)
	{}

The application of the annotation @A is incorrect because it has too many positional arguments. The expected error extra_positional_arguments is not shown to the user in VSCode.

The error is correctly reported in the terminal when attempting dart run main.dart.

main.dart:1:3: Error: Too many positional arguments: 1 allowed, but 2 found.
Try removing the extra positional arguments.
@A([''], ['']) void main()
  ^
main.dart:3:23: Context: Found this candidate, but the arguments don't match.
extension type const A(List<String> strings)
                      ^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language spec

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions