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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 53583003: Implement latest spec changes regarding malformed types (see issue 14006): (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/code_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 29604)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -474,23 +474,14 @@
// Replace unresolved class with resolved type class.
const Type& parameterized_type = Type::Cast(type);
if (type_class.IsNull()) {
- if ((finalization == kCanonicalizeWellFormed) ||
- FLAG_error_on_bad_type) {
- // The type class could not be resolved. The type is malformed.
- FinalizeMalformedType(
- Error::Handle(), // No previous error.
- Script::Handle(cls.script()),
- parameterized_type,
- "cannot resolve class '%s' from '%s'",
- String::Handle(unresolved_class.Name()).ToCString(),
- String::Handle(cls.Name()).ToCString());
- } else {
- // Map the malformed type to dynamic and ignore type arguments.
- parameterized_type.set_type_class(Class::Handle(
- Object::dynamic_class()));
- parameterized_type.set_arguments(
- Object::null_abstract_type_arguments());
- }
+ // The type class could not be resolved. The type is malformed.
+ FinalizeMalformedType(
+ Error::Handle(), // No previous error.
+ Script::Handle(cls.script()),
+ parameterized_type,
+ "cannot resolve class '%s' from '%s'",
+ String::Handle(unresolved_class.Name()).ToCString(),
+ String::Handle(cls.Name()).ToCString());
return;
}
parameterized_type.set_type_class(type_class);
@@ -983,8 +974,7 @@
// interface.
ResolveType(cls, type, kCanonicalize);
type = FinalizeType(cls, type, kCanonicalize);
- // A malformed result type is mapped to dynamic.
- ASSERT(!type.IsMalformed());
+ // The result type may be malformed or malbounded.
function.set_result_type(type);
// Resolve formal parameter types.
const intptr_t num_parameters = function.NumParameters();
@@ -992,8 +982,7 @@
type = function.ParameterTypeAt(i);
ResolveType(cls, type, kCanonicalize);
type = FinalizeType(cls, type, kCanonicalize);
- // A malformed parameter type is mapped to dynamic.
- ASSERT(!type.IsMalformed());
+ // The parameter type may be malformed or malbounded.
function.SetParameterTypeAt(i, type);
}
}
« no previous file with comments | « runtime/lib/errors_patch.dart ('k') | runtime/vm/code_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698