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

Unified Diff: pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart

Issue 2963003002: Include types of ClassTypeAlias into subtyped names. (Closed)
Patch Set: Created 3 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/dart/analysis/referenced_names.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/dart/analysis/referenced_names_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart b/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart
index 994485d0b8a25fc722d2cf92a2f4f91747b21abc..f829d2452569472bf28aa79fdac07995e91fecf9 100644
--- a/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart
@@ -413,6 +413,24 @@ main() {
@reflectiveTest
class ComputeSubtypedNamesTest extends ParserTestCase {
+ void test_classDeclaration() {
+ Set<String> names = _computeSubtypedNames('''
+import 'lib.dart';
+class X extends A {}
+class Y extends A with B {}
+class Z implements A, B, C {}
+''');
+ expect(names, unorderedEquals(['A', 'B', 'C']));
+ }
+
+ void test_classTypeAlias() {
+ Set<String> names = _computeSubtypedNames('''
+import 'lib.dart';
+class X = A with B implements C, D, E;
+''');
+ expect(names, unorderedEquals(['A', 'B', 'C', 'D', 'E']));
+ }
+
void test_prefixed() {
Set<String> names = _computeSubtypedNames('''
import 'lib.dart' as p;
@@ -429,16 +447,6 @@ class X extends A<B> {}
expect(names, unorderedEquals(['A']));
}
- void test_unprefixed() {
- Set<String> names = _computeSubtypedNames('''
-import 'lib.dart';
-class X extends A {}
-class Y extends A with B {}
-class Z implements A, B, C {}
-''');
- expect(names, unorderedEquals(['A', 'B', 'C']));
- }
-
Set<String> _computeSubtypedNames(String code) {
CompilationUnit unit = parseCompilationUnit2(code);
return computeSubtypedNames(unit);
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/referenced_names.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698