linter: always_specify_types: add test with type parameter with bound
Fixes https://github.com/dart-lang/sdk/issues/57665 Change-Id: Idced0de7de239de8f46712dc8d48025caa88a7a4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/503621 Reviewed-by: Keerti Parthasarathy <keertip@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
0aa709e8cc
commit
8f07aef955
@@ -28,20 +28,6 @@ final Foo1 foo = Foo1();
|
||||
''');
|
||||
}
|
||||
|
||||
test_34() async {
|
||||
// https://github.com/dart-lang/linter/issues/851
|
||||
await assertNoDiagnostics(r'''
|
||||
import 'package:meta/meta.dart';
|
||||
void f() {
|
||||
g<dynamic>();
|
||||
g();
|
||||
}
|
||||
|
||||
@optionalTypeArgs
|
||||
void g<T>() {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_catchVariable_omitted() async {
|
||||
// https://codereview.chromium.org/1427223002/
|
||||
await assertNoDiagnostics(r'''
|
||||
@@ -493,6 +479,34 @@ void f() {
|
||||
);
|
||||
}
|
||||
|
||||
test_function_optionalTypeArgs() async {
|
||||
// https://github.com/dart-lang/linter/issues/851
|
||||
await assertNoDiagnostics(r'''
|
||||
import 'package:meta/meta.dart';
|
||||
void f() {
|
||||
g<dynamic>();
|
||||
g();
|
||||
}
|
||||
|
||||
@optionalTypeArgs
|
||||
void g<T>() {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_function_optionalTypeArgs_withBound() async {
|
||||
// https://github.com/dart-lang/linter/issues/851
|
||||
await assertNoDiagnostics(r'''
|
||||
import 'package:meta/meta.dart';
|
||||
void f() {
|
||||
g<Object>();
|
||||
g();
|
||||
}
|
||||
|
||||
@optionalTypeArgs
|
||||
void g<T extends Object>() {}
|
||||
''');
|
||||
}
|
||||
|
||||
test_function_parameterType_explicit() async {
|
||||
await assertNoDiagnostics(r'''
|
||||
void f(int x) {}
|
||||
|
||||
Reference in New Issue
Block a user