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

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

Issue 1746963002: Follow ClassTypeAlias constructor redirections. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Simplify the method and fix the bug. 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 afd06d23a9398ccee6bc3a94bdd0a296ecec2200..76621f72e250902b228ae11316f46b27d94f069b 100644
--- a/pkg/analyzer/test/src/summary/index_unit_test.dart
+++ b/pkg/analyzer/test/src/summary/index_unit_test.dart
@@ -437,16 +437,36 @@ class A implements B {
A.named() {}
}
class B = A with M;
+class C = B with M;
main() {
- new B(); // 1
- new B.named(); // 2
+ new B(); // B1
+ new B.named(); // B2
+ new C(); // C1
+ new C.named(); // C2
}
''');
ClassElement classA = findElement('A');
ConstructorElement constA = classA.constructors[0];
ConstructorElement constA_named = classA.constructors[1];
- assertThat(constA).isReferencedAt('(); // 1', length: 0);
- assertThat(constA_named).isReferencedAt('.named(); // 2', length: 6);
+ assertThat(constA)
+ ..isReferencedAt('(); // B1', length: 0)
+ ..isReferencedAt('(); // C1', length: 0);
+ assertThat(constA_named)
+ ..isReferencedAt('.named(); // B2', length: 6)
+ ..isReferencedAt('.named(); // C2', length: 6);
+ }
+
+ void test_isReferencedBy_ConstructorElement_classTypeAlias_cycle() {
+ _indexTestUnit('''
+class M {}
+class A = B with M;
+class B = A with M;
+main() {
+ new A();
+ new B();
+}
+''');
+ // No additional validation, but it should not fail with stack overflow.
}
void test_isReferencedBy_ConstructorElement_redirection() {
« 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