Minor improvements to error messages.
In case of conflict, show the location of the original rule.
--
PiperOrigin-RevId: 143541281
MOS_MIGRATED_REVID=143541281
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java b/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
index e3468da..dfbf43a 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
@@ -580,12 +580,13 @@
if (!(items instanceof Map<?, ?>)) {
throw new EvalException(
location,
- "argument after ** must be a dictionary, not " + EvalUtils.getDataTypeName(items));
+ "argument after ** must be a dictionary, not '" + EvalUtils.getDataTypeName(items) + "'");
}
for (Map.Entry<?, ?> entry : ((Map<?, ?>) items).entrySet()) {
if (!(entry.getKey() instanceof String)) {
throw new EvalException(
- location, "keywords must be strings, not " + EvalUtils.getDataTypeName(entry.getKey()));
+ location,
+ "keywords must be strings, not '" + EvalUtils.getDataTypeName(entry.getKey()) + "'");
}
addKeywordArg(kwargs, (String) entry.getKey(), entry.getValue(), duplicates);
}