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

Unified Diff: vm/parser.cc

Issue 10969002: Issue a more meaningful error message when we see duplicate definitions (ambiguous reference) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/parser.cc
===================================================================
--- vm/parser.cc (revision 12610)
+++ vm/parser.cc (working copy)
@@ -7986,12 +7986,20 @@
if (!resolved_obj.IsNull()) {
if (!first_lib_url.IsNull()) {
// Found duplicate definition.
- ErrorMsg(ident_pos,
- "ambiguous reference: "
- "'%s' is defined in library '%s' and also in '%s'",
- name.ToCString(),
- first_lib_url.ToCString(),
- String::Handle(lib.url()).ToCString());
+ if (first_lib_url.raw() == lib.url()) {
+ ErrorMsg(ident_pos,
+ "ambiguous reference: "
+ "'%s' as library '%s' is imported multiple times",
+ name.ToCString(),
+ first_lib_url.ToCString());
+ } else {
+ ErrorMsg(ident_pos,
+ "ambiguous reference: "
+ "'%s' is defined in library '%s' and also in '%s'",
+ name.ToCString(),
+ first_lib_url.ToCString(),
+ String::Handle(lib.url()).ToCString());
+ }
} else {
first_lib_url = lib.url();
obj = resolved_obj.raw();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698