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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 11275188: Merge of ErroneousElement and ErroneousFunctionElement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Status updated Created 8 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 | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/elements/elements.dart
diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index eea55b77aa95dc5e3e97a87c4ff2b25260dd5a2c..684ba90b8647ead4c308bca9d4fde54070c6bbda 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -379,15 +379,13 @@ class Element implements Spannable {
* to check for unresolvable elements instead of
* [: element == null :].
*/
-class ErroneousElement extends Element {
+class ErroneousElement extends Element implements FunctionElement {
final MessageKind messageKind;
final List messageArguments;
- final SourceString targetName;
ErroneousElement(this.messageKind, this.messageArguments,
- this.targetName, Element enclosing)
- : super(const SourceString('erroneous element'),
- ElementKind.ERROR, enclosing);
+ SourceString name, Element enclosing)
+ : super(name, ElementKind.ERROR, enclosing);
isErroneous() => true;
@@ -395,23 +393,7 @@ class ErroneousElement extends Element {
throw 'unsupported operation on erroneous element';
}
- SourceString get name => unsupported();
Link<MetadataAnnotation> get metadata => unsupported();
-
- getLibrary() => enclosingElement.getLibrary();
-
- String toString() {
- String n = targetName.slowToString();
- return '<$n: ${messageKind.message(messageArguments)}>';
- }
-}
-
-class ErroneousFunctionElement extends ErroneousElement
- implements FunctionElement {
- ErroneousFunctionElement(MessageKind messageKind, List messageArguments,
- SourceString targetName, Element enclosing)
- : super(messageKind, messageArguments, targetName, enclosing);
-
get type => unsupported();
get cachedNode => unsupported();
get functionSignature => unsupported();
@@ -427,6 +409,13 @@ class ErroneousFunctionElement extends ErroneousElement
parameterCount(copmiler) => unsupported();
get redirectionTarget => this;
+
+ getLibrary() => enclosingElement.getLibrary();
+
+ String toString() {
+ String n = name.slowToString();
+ return '<$n: ${messageKind.message(messageArguments)}>';
+ }
}
/**
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698