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

Unified Diff: runtime/vm/code_generator_test.cc

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://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
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_test.cc
===================================================================
--- runtime/vm/code_generator_test.cc (revision 25321)
+++ runtime/vm/code_generator_test.cc (working copy)
@@ -272,7 +272,8 @@
static RawClass* LookupClass(const Library& lib, const char* name) {
const String& cls_name = String::ZoneHandle(Symbols::New(name));
- return lib.LookupClass(cls_name);
+ String& ambiguity_error_msg = String::Handle();
+ return lib.LookupClass(cls_name, &ambiguity_error_msg);
}
@@ -292,7 +293,7 @@
EXPECT(CompilerTest::TestCompileScript(lib, script));
EXPECT(ClassFinalizer::FinalizePendingClasses());
Class& cls = Class::Handle(LookupClass(lib, "A"));
- EXPECT(!cls.IsNull());
+ EXPECT(!cls.IsNull()); // No ambiguity error expected.
// 'bar' will not be compiled.
String& function_bar_name = String::Handle(String::New("bar"));
@@ -339,7 +340,7 @@
EXPECT(CompilerTest::TestCompileScript(lib, script));
EXPECT(ClassFinalizer::FinalizePendingClasses());
Class& cls = Class::ZoneHandle(LookupClass(lib, "A"));
- EXPECT(!cls.IsNull());
+ EXPECT(!cls.IsNull()); // No ambiguity error expected.
String& constructor_name = String::Handle(String::New("A."));
Function& constructor =
@@ -525,7 +526,7 @@
EXPECT(CompilerTest::TestCompileScript(lib, script));
EXPECT(ClassFinalizer::FinalizePendingClasses());
Class& cls = Class::ZoneHandle(LookupClass(lib, "A"));
- EXPECT(!cls.IsNull());
+ EXPECT(!cls.IsNull()); // No ambiguity error expected.
String& constructor_name = String::Handle(String::New("A."));
Function& constructor =
@@ -551,9 +552,11 @@
Library& app_lib = Library::Handle();
app_lib ^= libs.At(num_libs - 1);
ASSERT(!app_lib.IsNull());
+ String& ambiguity_error_msg = String::Handle();
const Class& cls = Class::Handle(
- app_lib.LookupClass(String::Handle(Symbols::New("A"))));
- EXPECT_EQ(cls.raw(), result.clazz());
+ app_lib.LookupClass(String::Handle(Symbols::New("A")),
+ &ambiguity_error_msg));
+ EXPECT_EQ(cls.raw(), result.clazz()); // No ambiguity error expected.
}
} // namespace dart
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698