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

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

Issue 11970011: Add an element for mixin applications. For now, the resolver complains about mixin applications -- … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
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 a158b66fe699d1566d3c9d45bdb390447db9e486..38bb2bd0be537d19254cbfb009b663f9a4d29e6b 100644
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -1401,13 +1401,6 @@ abstract class BaseClassElementX extends ElementX implements ClassElement {
Link<DartType> get typeVariables => thisType.typeArguments;
- ClassElement ensureResolved(Compiler compiler) {
- if (resolutionState == STATE_NOT_STARTED) {
- compiler.resolver.resolveClass(this);
- }
- return this;
- }
-
void addBackendMember(Element member) {
backendMembers = backendMembers.prepend(member);
}
@@ -1747,6 +1740,13 @@ abstract class ClassElementX extends BaseClassElementX {
return false;
}
+ ClassElement ensureResolved(Compiler compiler) {
+ if (resolutionState == STATE_NOT_STARTED) {
+ compiler.resolver.resolveClass(this);
+ }
+ return this;
+ }
+
Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this);
String toString() {
@@ -1761,20 +1761,31 @@ abstract class ClassElementX extends BaseClassElementX {
}
class MixinApplicationElementX extends BaseClassElementX {
- MixinApplicationElementX(SourceString name,
- Element enclosing,
- int id,
- int initialState)
- : super(name, enclosing, id, initialState);
+ final MixinApplication cachedNode;
ahe 2013/01/18 12:15:48 If it is final, you can just call it "node".
// TODO(kasperl): The analyzer complains when I don't have these two
// fields. This is pretty weird. I cannot replace them with getters.
final ClassElement patch = null;
final ClassElement origin = null;
+ MixinApplicationElementX(SourceString name, Element enclosing, int id,
+ this.cachedNode)
+ : super(name, enclosing, id, STATE_NOT_STARTED);
+
bool get hasConstructor => false;
bool get hasLocalScopeMembers => false;
+ Token position() => cachedNode.getBeginToken();
+
+ Node parseNode(DiagnosticListener listener) => cachedNode;
+
+ ClassElement ensureResolved(Compiler compiler) {
+ if (resolutionState == STATE_NOT_STARTED) {
+ compiler.resolver.resolveMixinApplication(this);
+ }
+ return this;
+ }
+
Element localLookup(SourceString name) {
// TODO(kasperl): Unimplemented for now.
return null;

Powered by Google App Engine
This is Rietveld 408576698