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

Unified Diff: pkg/analyzer/test/src/summary/index_unit_test.dart

Issue 1761073004: Don't index constructor element reference second time. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/summary/index_unit.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/src/summary/index_unit_test.dart
diff --git a/pkg/analyzer/test/src/summary/index_unit_test.dart b/pkg/analyzer/test/src/summary/index_unit_test.dart
index bfa331ff7f7ae97808231d3032a0fd536226f38a..38e0e44bcfa3c498a4172e446a4aec7b10e6df32 100644
--- a/pkg/analyzer/test/src/summary/index_unit_test.dart
+++ b/pkg/analyzer/test/src/summary/index_unit_test.dart
@@ -540,6 +540,22 @@ main() {
// No additional validation, but it should not fail with stack overflow.
}
+ void test_isReferencedBy_ConstructorElement_namedOnlyWithDot() {
+ _indexTestUnit('''
+class A {
+ A.named() {}
+}
+main() {
+ new A.named();
+}
+''');
+ // has ".named()", but does not have "named()"
+ int offsetWithoutDot = findOffset('named();');
+ int offsetWithDot = findOffset('.named();');
+ expect(unitIndex.usedElementOffsets, isNot(contains(offsetWithoutDot)));
+ expect(unitIndex.usedElementOffsets, contains(offsetWithDot));
+ }
+
void test_isReferencedBy_ConstructorElement_redirection() {
_indexTestUnit('''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/summary/index_unit.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698