-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.
Description
Dart version: 3.10.0
dart analyze does not flag the following code even though it fails to compile:
abstract class Foo<T> {
factory Foo.a() = _Foo;
Foo();
}
class _Foo<T> extends Foo<T> {
_Foo();
}
Foo<T> bar<T>() => .a<T>();The following error is emitted when the code is compiled:
Error: A dot shorthand constructor invocation can't have type arguments.
Try adding the class name and type arguments explicitly before the constructor name.
Foo<T> bar<T>() => .a<T>();
^
Metadata
Metadata
Assignees
Labels
area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.