-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagefeature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.
Description
Dart SDK version: 3.9.0-252.0.dev (dev) (Thu Jun 19 05:08:58 2025 -0700) on "macos_x64"
Analyzer via VSCode with lint rule prefer_const_constructors enabled
class A
{ A():
cannotBeConst=0;
int cannotBeConst;
}
extension type const B(A a)
{}
B get b=>
.new(A()); // Nonexpected error `prefer_const_constructors` :(The lint rule prefer_const_constructors should not be triggered here because const cannot be used in this case. This is only an issue when the dot shorthand .new is used
B get b=>
B(A()); // no dot-shorthand, no error :)Metadata
Metadata
Assignees
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagefeature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.