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

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

Issue 304153014: Remove element from DynamicType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix infinite loop. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index 4bdad1467c324d2973478c56d80b2399664b82d9..b1939b734f838379dc2b48d153602a30bbe8253b 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -151,7 +151,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
value != null &&
element.isField) {
DartType elementType = element.type;
- if (elementType.kind == TypeKind.MALFORMED_TYPE && !value.isNull) {
+ if (elementType.isMalformed && !value.isNull) {
if (isConst) {
ErroneousElement element = elementType.element;
compiler.reportFatalError(
@@ -407,8 +407,7 @@ class CompileTimeConstantEvaluator extends Visitor {
node, type, compiler.symbolConstructor, createArguments);
}
- Constant makeTypeConstant(TypeDeclarationElement element) {
- DartType elementType = element.rawType;
+ Constant makeTypeConstant(DartType elementType) {
DartType constantType =
compiler.backend.typeImplementation.computeType(compiler);
return new TypeConstant(elementType, constantType);
@@ -425,7 +424,8 @@ class CompileTimeConstantEvaluator extends Visitor {
Constant visitIdentifier(Identifier node) {
Element element = elements[node];
if (Elements.isClass(element) || Elements.isTypedef(element)) {
- return makeTypeConstant(element);
+ TypeDeclarationElement typeDeclarationElement = element;
+ return makeTypeConstant(typeDeclarationElement.rawType);
}
return signalNotCompileTimeConstant(node);
}
@@ -450,7 +450,7 @@ class CompileTimeConstantEvaluator extends Visitor {
if (result != null) return result;
} else if (Elements.isClass(element) || Elements.isTypedef(element)) {
assert(elements.isTypeLiteral(send));
- return makeTypeConstant(element);
+ return makeTypeConstant(elements.getTypeLiteralType(send));
} else if (send.receiver != null) {
// Fall through to error handling.
} else if (!Elements.isUnresolved(element)
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/closure.dart ('k') | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698