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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 15831003: Revert "Allow ambiguous Expect and ExpectException imports." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 import 'dart:collection' show LinkedHashMap; 8 import 'dart:collection' show LinkedHashMap;
9 9
10 import 'elements.dart'; 10 import 'elements.dart';
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 /** 615 /**
616 * Adds [element] to the import scope of this library. 616 * Adds [element] to the import scope of this library.
617 * 617 *
618 * If an element by the same name is already in the imported scope, an 618 * If an element by the same name is already in the imported scope, an
619 * [ErroneousElement] will be put in the imported scope, allowing for the 619 * [ErroneousElement] will be put in the imported scope, allowing for the
620 * detection of ambiguous uses of imported names. 620 * detection of ambiguous uses of imported names.
621 */ 621 */
622 void addImport(Element element, DiagnosticListener listener) { 622 void addImport(Element element, DiagnosticListener listener) {
623 Element existing = importScope[element.name]; 623 Element existing = importScope[element.name];
624 if (existing != null) { 624 if (existing != null) {
625 // TODO(8474): Remove the "Expect" special casing.
626 if (element.name == const SourceString("Expect") ||
627 element.name == const SourceString("ExpectException")) {
628 return;
629 }
630 // TODO(johnniwinther): Provide access to the import tags from which 625 // TODO(johnniwinther): Provide access to the import tags from which
631 // the elements came. 626 // the elements came.
632 importScope[element.name] = new AmbiguousElementX( 627 importScope[element.name] = new AmbiguousElementX(
633 MessageKind.DUPLICATE_IMPORT, {'name': element.name}, 628 MessageKind.DUPLICATE_IMPORT, {'name': element.name},
634 this, existing, element); 629 this, existing, element);
635 } else { 630 } else {
636 importScope[element.name] = element; 631 importScope[element.name] = element;
637 } 632 }
638 } 633 }
639 634
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 2095
2101 MetadataAnnotation ensureResolved(Compiler compiler) { 2096 MetadataAnnotation ensureResolved(Compiler compiler) {
2102 if (resolutionState == STATE_NOT_STARTED) { 2097 if (resolutionState == STATE_NOT_STARTED) {
2103 compiler.resolver.resolveMetadataAnnotation(this); 2098 compiler.resolver.resolveMetadataAnnotation(this);
2104 } 2099 }
2105 return this; 2100 return this;
2106 } 2101 }
2107 2102
2108 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2103 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2109 } 2104 }
OLDNEW
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698