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

Unified Diff: pkg/analysis_server/test/analysis/notification_highlights_test2.dart

Issue 1345943006: Report UNRESOLVED_INSTANCE_MEMBER_REFERENCE for dynamicVar.member references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more fixes Created 5 years, 3 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/analysis_server/lib/src/computer/computer_highlights2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_highlights_test2.dart
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
index dcbf39a6c3b1b38d8b5c0567e9c8e2da5a302036..5f3b79b96578888aa85333f8a7f58a01ad7ce913 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
@@ -1094,6 +1094,58 @@ class A<T> {
});
}
+ test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_dynamicVarTarget() {
+ addTestFile('''
+main(p) {
+ p.aaa;
+ p.aaa++;
+ p.aaa += 0;
+ ++p.aaa; // ++
+ p.aaa = 0;
+ p.bbb(0);
+ ''.length.ccc().ddd();
+}
+''');
+ return prepareHighlights().then((_) {
+ HighlightRegionType type =
+ HighlightRegionType.UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
+ assertHasRegion(type, 'aaa');
+ assertHasRegion(type, 'aaa++');
+ assertHasRegion(type, 'aaa += 0');
+ assertHasRegion(type, 'aaa; // ++');
+ assertHasRegion(type, 'aaa =');
+ assertHasRegion(type, 'bbb(');
+ assertHasRegion(type, 'ddd()');
+ });
+ }
+
+ test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_nonDynamicTarget() {
+ addTestFile('''
+import 'dart:math' as math;
+main(String str) {
+ new Object().aaa();
+ math.bbb();
+ str.ccc();
+}
+class A {
+ m() {
+ unresolved(1);
+ this.unresolved(2);
+ super.unresolved(3);
+ }
+}
+''');
+ return prepareHighlights().then((_) {
+ HighlightRegionType type = HighlightRegionType.IDENTIFIER_DEFAULT;
+ assertHasRegion(type, 'aaa()');
+ assertHasRegion(type, 'bbb()');
+ assertHasRegion(type, 'ccc()');
+ assertHasRegion(type, 'unresolved(1)');
+ assertHasRegion(type, 'unresolved(2)');
+ assertHasRegion(type, 'unresolved(3)');
+ });
+ }
+
void _addLibraryForTestPart() {
addFile(
'$testFolder/my_lib.dart',
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_highlights2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698