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

Side by Side Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1087223002: Capture annotations on enums (issue 23071) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 expect(continueStatement.target, same(whileStatement)); 1379 expect(continueStatement.target, same(whileStatement));
1380 _listener.assertNoErrors(); 1380 _listener.assertNoErrors();
1381 } 1381 }
1382 1382
1383 void test_visitContinueStatement_withoutLabel() { 1383 void test_visitContinueStatement_withoutLabel() {
1384 ContinueStatement statement = AstFactory.continueStatement(); 1384 ContinueStatement statement = AstFactory.continueStatement();
1385 _resolveStatement(statement, null, null); 1385 _resolveStatement(statement, null, null);
1386 _listener.assertNoErrors(); 1386 _listener.assertNoErrors();
1387 } 1387 }
1388 1388
1389 void test_visitEnumDeclaration() {
1390 ClassElementImpl enumElement =
1391 ElementFactory.enumElement(_typeProvider, ('E'));
1392 EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []);
1393 Annotation annotationNode =
1394 AstFactory.annotation(AstFactory.identifier3('a'));
1395 annotationNode.element = ElementFactory.classElement2('A');
1396 enumNode.metadata.add(annotationNode);
1397 enumNode.name.staticElement = enumElement;
1398 _resolveNode(enumNode);
1399 List<ElementAnnotation> metadata = enumElement.metadata;
1400 expect(metadata, hasLength(1));
1401 }
1402
1389 void test_visitExportDirective_noCombinators() { 1403 void test_visitExportDirective_noCombinators() {
1390 ExportDirective directive = AstFactory.exportDirective2(null); 1404 ExportDirective directive = AstFactory.exportDirective2(null);
1391 directive.element = ElementFactory 1405 directive.element = ElementFactory
1392 .exportFor(ElementFactory.library(_definingLibrary.context, "lib")); 1406 .exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
1393 _resolveNode(directive); 1407 _resolveNode(directive);
1394 _listener.assertNoErrors(); 1408 _listener.assertNoErrors();
1395 } 1409 }
1396 1410
1397 void test_visitFieldFormalParameter() { 1411 void test_visitFieldFormalParameter() {
1398 String fieldName = "f"; 1412 String fieldName = "f";
(...skipping 12319 matching lines...) Expand 10 before | Expand all | Expand 10 after
13718 // check propagated type 13732 // check propagated type
13719 FunctionType propagatedType = node.propagatedType as FunctionType; 13733 FunctionType propagatedType = node.propagatedType as FunctionType;
13720 expect(propagatedType.returnType, test.typeProvider.stringType); 13734 expect(propagatedType.returnType, test.typeProvider.stringType);
13721 } on AnalysisException catch (e, stackTrace) { 13735 } on AnalysisException catch (e, stackTrace) {
13722 thrownException[0] = new CaughtException(e, stackTrace); 13736 thrownException[0] = new CaughtException(e, stackTrace);
13723 } 13737 }
13724 } 13738 }
13725 return null; 13739 return null;
13726 } 13740 }
13727 } 13741 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698