Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 1975383002: Verify that required param constants are accessible outside the declaring lib (#26440). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a05a39ed3c9f0e1110ba3de3fec1cc73f33e665..39752705c06ccf3780e8a592c3452bb3a52d2117 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -1738,6 +1738,29 @@ f() {
verify([source]);
}
+ void test_required_method_param_in_other_lib() {
+ addNamedSource(
+ '/a_lib.dart',
+ r'''
+library a_lib;
+import 'package:meta/meta.dart';
+class A {
+ void m({@Required('must specify an `a`') int a}) {}
+}
+''');
+
+ Source source = addSource(r'''
+import "a_lib.dart";
+f() {
+ new A().m();
+}
+''');
+
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [HintCode.MISSING_REQUIRED_PARAM_WITH_DETAILS]);
+ verify([source]);
+ }
+
void test_typeCheck_type_is_Null() {
Source source = addSource(r'''
m(i) {
@@ -1765,8 +1788,7 @@ import 'lib1.dart' hide a;''');
addNamedSource("/lib1.dart", "library lib1;");
computeLibrarySourceErrors(source);
assertErrors(
- source,
- [HintCode.UNUSED_IMPORT, HintCode.UNDEFINED_HIDDEN_NAME]);
+ source, [HintCode.UNUSED_IMPORT, HintCode.UNDEFINED_HIDDEN_NAME]);
verify([source]);
}
@@ -1777,8 +1799,7 @@ import 'lib1.dart' show a;''');
addNamedSource("/lib1.dart", "library lib1;");
computeLibrarySourceErrors(source);
assertErrors(
- source,
- [HintCode.UNUSED_IMPORT, HintCode.UNDEFINED_SHOWN_NAME]);
+ source, [HintCode.UNUSED_IMPORT, HintCode.UNDEFINED_SHOWN_NAME]);
verify([source]);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698