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 310707ef866413f5c779044c3f96013073f15a82..e384012bee17432a83dda2bcdde52074cff5667b 100644 |
--- a/pkg/analyzer/test/generated/hint_code_test.dart |
+++ b/pkg/analyzer/test/generated/hint_code_test.dart |
@@ -1105,6 +1105,23 @@ abstract class B implements A { |
verify([source]); |
} |
+ void test_invalidUseOfProtectedMember_closure() { |
+ Source source = addSource(r''' |
+import 'package:meta/meta.dart'; |
+ |
+class A { |
+ @protected |
+ int a() => 42; |
+} |
+void main() { |
+ var leak = new A().a; |
+ print(leak); |
+}'''); |
+ computeLibrarySourceErrors(source); |
+ assertErrors(source, [HintCode.INVALID_USE_OF_PROTECTED_MEMBER]); |
+ verify([source]); |
+ } |
+ |
void test_invalidUseOfProtectedMember_getter() { |
Source source = addSource(r''' |
import 'package:meta/meta.dart'; |