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

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

Issue 11412245: MalformedType used for all invalid type annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years 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 8e8a3b56a6e51d61f781391804ea9b87da6604d1..7eb4167f176815f2929709079b3de734747a55fc 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -175,7 +175,8 @@ class ConstantHandler extends CompilerTask {
&& element.isField()) {
DartType elementType = element.computeType(compiler);
DartType constantType = value.computeType(compiler);
- if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
+ if (elementType.isMalformed || constantType.isMalformed ||
+ !constantSystem.isSubtype(compiler, constantType, elementType)) {
if (isConst) {
MessageKind kind = MessageKind.NOT_ASSIGNABLE;
compiler.reportError(node, new CompileTimeConstantError(
@@ -740,7 +741,8 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
DartType constantType = constant.computeType(compiler);
// TODO(ngeoffray): Handle type parameters.
if (elementType.element.isTypeVariable()) return;
- if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
+ if (elementType.isMalformed || constantType.isMalformed ||
+ !constantSystem.isSubtype(compiler, constantType, elementType)) {
MessageKind kind = MessageKind.NOT_ASSIGNABLE;
compiler.reportError(node, new CompileTimeConstantError(
kind, [elementType, constantType]));

Powered by Google App Engine
This is Rietveld 408576698