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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 23484020: Update handling of ambiguous name references (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/vm/class_finalizer.h ('k') | runtime/vm/code_descriptors_test.cc » ('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 27310)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -253,29 +253,22 @@
// Resolve unresolved_class in the library of cls, or return null.
-RawClass* ClassFinalizer::ResolveClass(const Class& cls,
- const UnresolvedClass& unresolved_class,
- Error* ambiguity_error) {
+RawClass* ClassFinalizer::ResolveClass(
+ const Class& cls,
+ const UnresolvedClass& unresolved_class) {
const String& class_name = String::Handle(unresolved_class.ident());
Library& lib = Library::Handle();
Class& resolved_class = Class::Handle();
- String& ambiguity_error_msg = String::Handle();
if (unresolved_class.library_prefix() == LibraryPrefix::null()) {
lib = cls.library();
ASSERT(!lib.IsNull());
- resolved_class = lib.LookupClass(class_name, &ambiguity_error_msg);
+ resolved_class = lib.LookupClass(class_name);
} else {
LibraryPrefix& lib_prefix = LibraryPrefix::Handle();
lib_prefix = unresolved_class.library_prefix();
ASSERT(!lib_prefix.IsNull());
- resolved_class = lib_prefix.LookupClass(class_name, &ambiguity_error_msg);
+ resolved_class = lib_prefix.LookupClass(class_name);
}
- if (resolved_class.IsNull() && !ambiguity_error_msg.IsNull()) {
- const Script& script = Script::Handle(cls.script());
- *ambiguity_error = Parser::FormatErrorMsg(
- script, unresolved_class.token_pos(), "Error",
- "%s", ambiguity_error_msg.ToCString());
- }
return resolved_class.raw();
}
@@ -467,9 +460,8 @@
// Lookup the type class.
const UnresolvedClass& unresolved_class =
UnresolvedClass::Handle(type.unresolved_class());
- Error& ambiguous_error = Error::Handle();
const Class& type_class =
- Class::Handle(ResolveClass(cls, unresolved_class, &ambiguous_error));
+ Class::Handle(ResolveClass(cls, unresolved_class));
// Replace unresolved class with resolved type class.
const Type& parameterized_type = Type::Cast(type);
@@ -478,7 +470,7 @@
FLAG_error_on_bad_type) {
// The type class could not be resolved. The type is malformed.
FinalizeMalformedType(
- ambiguous_error, // May be null.
+ Error::Handle(), // No previous error.
cls,
parameterized_type,
"cannot resolve class '%s' from '%s'",
« no previous file with comments | « runtime/vm/class_finalizer.h ('k') | runtime/vm/code_descriptors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698