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

Side by Side Diff: lib/compiler/implementation/elements/elements.dart

Issue 10638013: Improve tracking of the type of fields after object construction (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Type computeType(Compiler compiler) { 111 Type computeType(Compiler compiler) {
112 compiler.internalError("$this.computeType.", token: position()); 112 compiler.internalError("$this.computeType.", token: position());
113 } 113 }
114 114
115 bool isFunction() => kind === ElementKind.FUNCTION; 115 bool isFunction() => kind === ElementKind.FUNCTION;
116 bool isMember() => 116 bool isMember() =>
117 enclosingElement !== null && enclosingElement.kind === ElementKind.CLASS; 117 enclosingElement !== null && enclosingElement.kind === ElementKind.CLASS;
118 bool isInstanceMember() => false; 118 bool isInstanceMember() => false;
119 bool isFactoryConstructor() => modifiers !== null && modifiers.isFactory(); 119 bool isFactoryConstructor() => modifiers !== null && modifiers.isFactory();
120 bool isGenerativeConstructor() => kind === ElementKind.GENERATIVE_CONSTRUCTOR; 120 bool isGenerativeConstructor() => kind === ElementKind.GENERATIVE_CONSTRUCTOR;
121 bool isGenerativeConstructorBody() =>
122 kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY;
121 bool isCompilationUnit() { 123 bool isCompilationUnit() {
122 return kind === ElementKind.COMPILATION_UNIT || 124 return kind === ElementKind.COMPILATION_UNIT ||
123 kind === ElementKind.LIBRARY; 125 kind === ElementKind.LIBRARY;
124 } 126 }
125 bool isClass() => kind === ElementKind.CLASS; 127 bool isClass() => kind === ElementKind.CLASS;
126 bool isPrefix() => kind === ElementKind.PREFIX; 128 bool isPrefix() => kind === ElementKind.PREFIX;
127 bool isVariable() => kind === ElementKind.VARIABLE; 129 bool isVariable() => kind === ElementKind.VARIABLE;
128 bool isParameter() => kind === ElementKind.PARAMETER; 130 bool isParameter() => kind === ElementKind.PARAMETER;
129 bool isStatement() => kind === ElementKind.STATEMENT; 131 bool isStatement() => kind === ElementKind.STATEMENT;
130 bool isTypedef() => kind === ElementKind.TYPEDEF; 132 bool isTypedef() => kind === ElementKind.TYPEDEF;
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 final Node node; 1064 final Node node;
1063 Type bound; 1065 Type bound;
1064 Type type; 1066 Type type;
1065 TypeVariableElement(name, Element enclosing, this.node, this.type, 1067 TypeVariableElement(name, Element enclosing, this.node, this.type,
1066 [this.bound]) 1068 [this.bound])
1067 : super(name, ElementKind.TYPE_VARIABLE, enclosing); 1069 : super(name, ElementKind.TYPE_VARIABLE, enclosing);
1068 Type computeType(compiler) => type; 1070 Type computeType(compiler) => type;
1069 Node parseNode(compiler) => node; 1071 Node parseNode(compiler) => node;
1070 toString() => "${enclosingElement.toString()}.${name.slowToString()}"; 1072 toString() => "${enclosingElement.toString()}.${name.slowToString()}";
1071 } 1073 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698