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

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

Issue 2041873003: Fix @protected to include closure references (linter#255). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/resolver.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 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';
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698