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

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

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 79c9a27d0c528bef41b72dbe8e62add93e0aa176..2db7033ba8e9426dc6465b5f322561435fe97753 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -200,8 +200,7 @@ class ConstantHandler extends CompilerTask {
&& element.isField()) {
DartType elementType = element.computeType(compiler);
DartType constantType = value.computeType(compiler);
- if (elementType.isMalformed || constantType.isMalformed ||
- !constantSystem.isSubtype(compiler, constantType, elementType)) {
+ if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
if (isConst) {
compiler.reportError(node, new CompileTimeConstantError(
MessageKind.NOT_ASSIGNABLE,
@@ -793,8 +792,7 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
DartType constantType = constant.computeType(compiler);
// TODO(ngeoffray): Handle type parameters.
if (elementType.element.isTypeVariable()) return;
- if (elementType.isMalformed || constantType.isMalformed ||
- !constantSystem.isSubtype(compiler, constantType, elementType)) {
+ if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
compiler.reportError(node, new CompileTimeConstantError(
MessageKind.NOT_ASSIGNABLE,
{'fromType': elementType, 'toType': constantType}));

Powered by Google App Engine
This is Rietveld 408576698