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

Unified Diff: pkg/analyzer2dart/test/identifier_semantics_test.dart

Issue 712313004: Fix AccessSemantics for function typedefs and "dynamic". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/analyzer2dart/lib/src/semantic_visitor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/identifier_semantics_test.dart
diff --git a/pkg/analyzer2dart/test/identifier_semantics_test.dart b/pkg/analyzer2dart/test/identifier_semantics_test.dart
index b5a05b7ec3786f74eed89d7512cc7306d807b464..f15762522e03ec25840f9db5c2e7e04aff1a58fd 100644
--- a/pkg/analyzer2dart/test/identifier_semantics_test.dart
+++ b/pkg/analyzer2dart/test/identifier_semantics_test.dart
@@ -1097,7 +1097,7 @@ f() {
class A {}
var t = A;
''');
- helper.checkTypeReference('A', 'A', AccessKind.TOPLEVEL_CLASS);
+ helper.checkTypeReference('A', 'A', AccessKind.TOPLEVEL_TYPE);
});
test('Get class defined at top level via prefix', () {
@@ -1111,7 +1111,62 @@ library lib;
class A;
''');
- helper.checkTypeReference('l.A', 'A', AccessKind.TOPLEVEL_CLASS);
+ helper.checkTypeReference('l.A', 'A', AccessKind.TOPLEVEL_TYPE);
+ });
+
+ test('Get dynamic type', () {
+ Helper helper = new Helper('''
+var t = dynamic;
+''');
+ helper.checkTypeReference('dynamic', 'dynamic', AccessKind.TOPLEVEL_TYPE);
+ });
+
+ test('Get function typedef defined at top level', () {
+ Helper helper = new Helper('''
+typedef F();
+var t = F;
+''');
+ helper.checkTypeReference('F', 'F', AccessKind.TOPLEVEL_TYPE);
+ });
+
+ test('Get function typedef defined at top level via prefix', () {
+ Helper helper = new Helper('''
+import 'lib.dart' as l;
+
+var t = l.F;
+''');
+ helper.addFile('/lib.dart', '''
+library lib;
+
+typedef F();
+''');
+ helper.checkTypeReference('l.F', 'F', AccessKind.TOPLEVEL_TYPE);
+ });
+
+ test('Get mixin application defined at top level', () {
+ Helper helper = new Helper('''
+class A {}
+class B {}
+class C = A with B;
+var t = C;
+''');
+ helper.checkTypeReference('C', 'C', AccessKind.TOPLEVEL_TYPE);
+ });
+
+ test('Get mixin application defined at top level via prefix', () {
+ Helper helper = new Helper('''
+import 'lib.dart' as l;
+
+var t = l.C;
+''');
+ helper.addFile('/lib.dart', '''
+library lib;
+
+class A;
+class B;
+class C = A with B;
+''');
+ helper.checkTypeReference('l.C', 'C', AccessKind.TOPLEVEL_TYPE);
});
test('Get type parameter of enclosing class', () {
« no previous file with comments | « pkg/analyzer2dart/lib/src/semantic_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698