Convert several SkylarkAttr methods to use @SkylarkCallable instead of @SkylarkSignature
RELNOTES: None.
PiperOrigin-RevId: 190129404
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
index 9ad90de..6f6a561 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
@@ -430,7 +430,8 @@
@Test
public void testNonLabelAttrWithProviders() throws Exception {
checkErrorContains(
- "unexpected keyword 'providers' in call to string", "attr.string(providers = ['a'])");
+ "unexpected keyword 'providers', in method call string(list providers)",
+ "attr.string(providers = ['a'])");
}
private static final RuleClass.ConfiguredTargetFactory<Object, Object, Exception>
@@ -499,8 +500,8 @@
@Test
public void testAttrDefaultValueBadType() throws Exception {
checkErrorContains(
- "argument 'default' has type 'int', but should be 'string'\n"
- + "in call to builtin function attr.string(*, default, doc, mandatory, values)",
+ "expected value of type 'string' for parameter 'default', "
+ + "in method call string(int default) of 'attr (a language module)'",
"attr.string(default = 1)");
}
@@ -528,7 +529,9 @@
@Test
public void testAttrBadKeywordArguments() throws Exception {
checkErrorContains(
- "unexpected keyword 'bad_keyword' in call to string", "attr.string(bad_keyword = '')");
+ "unexpected keyword 'bad_keyword', in method call string(string bad_keyword) "
+ + "of 'attr (a language module)'",
+ "attr.string(bad_keyword = '')");
}
@Test
@@ -588,8 +591,8 @@
@Test
public void testAttrDocValueBadType() throws Exception {
checkErrorContains(
- "argument 'doc' has type 'int', but should be 'string'\n"
- + "in call to builtin function attr.string(*, default, doc, mandatory, values)",
+ "expected value of type 'string' for parameter 'doc', "
+ + "in method call string(int doc) of 'attr (a language module)'",
"attr.string(doc = 1)");
}
@@ -608,8 +611,8 @@
@Test
public void testLateBoundAttrWorksWithOnlyLabel() throws Exception {
checkEvalError(
- "argument 'default' has type 'function', but should be 'string'\n"
- + "in call to builtin function attr.string(*, default, doc, mandatory, values)",
+ "expected value of type 'string' for parameter 'default', "
+ + "in method call string(function default) of 'attr (a language module)'",
"def attr_value(cfg): return 'a'",
"attr.string(default=attr_value)");
}
@@ -911,8 +914,9 @@
@Test
public void testLabelAttrWrongDefault() throws Exception {
checkErrorContains(
- "expected value of type 'string' for parameter 'default' of attribute 'label', "
- + "but got 123 (int)",
+ "expected value of type 'Label or string or SkylarkLateBoundDefault or "
+ + "function or NoneType' for parameter 'default', in method call "
+ + "label(int default) of 'attr (a language module)'",
"attr.label(default = 123)");
}