| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| index eb48b99e04a22800f2bd563b2ab8db66228b09dc..23237ef888fa3544e0d52710a14f0b3a97abcb7b 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -48,12 +48,12 @@ abstract class ElementX implements Element {
|
| Modifiers get modifiers => Modifiers.EMPTY;
|
|
|
| Node parseNode(DiagnosticListener listener) {
|
| - listener.internalErrorOnElement(this, 'not implemented');
|
| + listener.internalError(this, 'Not implemented.');
|
| return null;
|
| }
|
|
|
| DartType computeType(Compiler compiler) {
|
| - compiler.internalError("$this.computeType.", token: position());
|
| + compiler.internalError(this, "$this.computeType.");
|
| return null;
|
| }
|
|
|
| @@ -542,10 +542,13 @@ class ScopeX {
|
| Element existing,
|
| DiagnosticListener listener) {
|
| void reportError(Element other) {
|
| - // TODO(ahe): Do something similar to Resolver.reportErrorWithContext.
|
| - listener.cancel('duplicate definition of ${accessor.name}',
|
| - element: accessor);
|
| - listener.cancel('existing definition', element: other);
|
| + listener.reportError(accessor,
|
| + MessageKind.DUPLICATE_DEFINITION,
|
| + {'name': accessor.name});
|
| + // TODO(johnniwinther): Make this an info instead of a fatal error.
|
| + listener.reportFatalError(other,
|
| + MessageKind.EXISTING_DEFINITION,
|
| + {'name': accessor.name});
|
| }
|
|
|
| if (existing != null) {
|
| @@ -1186,8 +1189,8 @@ class VariableElementX extends ElementX with AnalyzableElement
|
| count++;
|
| }
|
| if (node == null) {
|
| - listener.cancel('internal error: could not find $name',
|
| - node: definitions);
|
| + listener.internalError(definitions,
|
| + "Could not find '$name'.");
|
| }
|
| if (count == 1) {
|
| definitionsCache = definitions;
|
| @@ -1618,8 +1621,8 @@ class FunctionElementX extends ElementX with AnalyzableElement
|
| FunctionExpression parseNode(DiagnosticListener listener) {
|
| if (patch == null) {
|
| if (modifiers.isExternal()) {
|
| - listener.cancel("Compiling external function with no implementation.",
|
| - element: this);
|
| + listener.internalError(this,
|
| + "Compiling external function with no implementation.");
|
| }
|
| }
|
| return cachedNode;
|
| @@ -1671,7 +1674,7 @@ class ConstructorBodyElementX extends FunctionElementX
|
| bool isInstanceMember() => true;
|
|
|
| FunctionType computeType(Compiler compiler) {
|
| - compiler.internalErrorOnElement(this, '$this.computeType.');
|
| + compiler.internalError(this, '$this.computeType.');
|
| return null;
|
| }
|
|
|
| @@ -2384,11 +2387,11 @@ class MixinApplicationElementX extends BaseClassElementX
|
| }
|
|
|
| void addMember(Element element, DiagnosticListener listener) {
|
| - throw new UnsupportedError("cannot add member to $this");
|
| + throw new UnsupportedError("Cannot add member to $this.");
|
| }
|
|
|
| void addToScope(Element element, DiagnosticListener listener) {
|
| - listener.internalError('cannot add to scope of $this', element: this);
|
| + listener.internalError(this, 'Cannot add to scope of $this.');
|
| }
|
|
|
| void addConstructor(FunctionElement constructor) {
|
|
|