| Index: pkg/analyzer/test/generated/hint_code_test.dart
|
| diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
|
| index 77b127fe4ca8a12414c1c1879e0015a818363cb4..0c3e3f60a7a036b05e94f89f41ffd5609c9c70e7 100644
|
| --- a/pkg/analyzer/test/generated/hint_code_test.dart
|
| +++ b/pkg/analyzer/test/generated/hint_code_test.dart
|
| @@ -1830,6 +1830,37 @@ main() {
|
| verify([source]);
|
| }
|
|
|
| + void test_required_constructor_param_redirecting_cons_call() {
|
| + Source source = addSource(r'''
|
| +import 'package:meta/meta.dart';
|
| +
|
| +class C {
|
| + C({@required int x});
|
| + C.named() : this();
|
| +}
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [HintCode.MISSING_REQUIRED_PARAM]);
|
| + verify([source]);
|
| + }
|
| +
|
| + void test_required_constructor_param_super_call() {
|
| + Source source = addSource(r'''
|
| +import 'package:meta/meta.dart';
|
| +
|
| +class C {
|
| + C({@Required('must specify an `a`') int a}) {}
|
| +}
|
| +
|
| +class D extends C {
|
| + D() : super();
|
| +}
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS]);
|
| + verify([source]);
|
| + }
|
| +
|
| void test_required_function_param() {
|
| Source source = addSource(r'''
|
| import 'package:meta/meta.dart';
|
| @@ -1883,6 +1914,23 @@ f() {
|
| verify([source]);
|
| }
|
|
|
| + void test_required_typedef_function_param() {
|
| + Source source = addSource(r'''
|
| +import 'package:meta/meta.dart';
|
| +
|
| +String test(C c) => c.m()();
|
| +
|
| +typedef String F({@required String x});
|
| +
|
| +class C {
|
| + F m() => ({@required String x}) => null;
|
| +}
|
| +''');
|
| + computeLibrarySourceErrors(source);
|
| + assertErrors(source, [HintCode.MISSING_REQUIRED_PARAM]);
|
| + verify([source]);
|
| + }
|
| +
|
| void test_typeCheck_type_is_Null() {
|
| Source source = addSource(r'''
|
| m(i) {
|
|
|