Skip to content

False Negative "argument_type_not_assignable" #60174

@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 #60172 and so it may be productive to fix them together.

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

@A(0) void main()
	{}
extension type const A(String _)
	{}

The application of the annotation @A is incorrect because the argument is a nonassignable type. The expected error argument_type_not_assignable 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:4: Error: The argument type 'int' can't be assigned to the parameter type 'String'.
@A(0) void main()
   ^

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