summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/maintransformer.py12
-rw-r--r--tests/warn/invalid-transfer.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 6c0429da..8fb37f89 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -567,16 +567,16 @@ class MainTransformer(object):
transfer = OPT_TRANSFER_NONE
if not isinstance(target, (ast.Class, ast.Interface)):
- message.warn('invalid "transfer" annotation: '
- 'only valid for object and interface types',
+ message.warn('invalid "transfer" annotation for {0}: '
+ 'only valid for object and interface types'.format(target),
annotations.position)
return
elif transfer == OPT_TRANSFER_CONTAINER:
if (ANN_ARRAY not in annotations and
not isinstance(target, (ast.Array, ast.List, ast.Map))):
- message.warn('invalid "transfer" annotation: '
- 'only valid for container types',
+ message.warn('invalid "transfer" annotation for {0}: '
+ 'only valid for container types'.format(target),
annotations.position)
return
@@ -585,9 +585,9 @@ class MainTransformer(object):
not isinstance(target, (ast.Array, ast.List, ast.Map,
ast.Record, ast.Compound, ast.Boxed,
ast.Class, ast.Interface))):
- message.warn('invalid "transfer" annotation: '
+ message.warn('invalid "transfer" annotation for {0}: '
'only valid for array, struct, union, boxed, '
- 'object and interface types',
+ 'object and interface types'.format(target),
annotations.position)
return
diff --git a/tests/warn/invalid-transfer.h b/tests/warn/invalid-transfer.h
index 054bb768..09ef4608 100644
--- a/tests/warn/invalid-transfer.h
+++ b/tests/warn/invalid-transfer.h
@@ -20,11 +20,11 @@ void test_transfer_invalid(GObject *param, GObject *param2, GObject *param3,
// EXPECT:7: Warning: Test: "transfer" annotation needs one option, none given
// EXPECT:8: Warning: Test: invalid "transfer" annotation option: "invalid"
// EXPECT:9: Warning: Test: "transfer" annotation needs one option, 2 given
-// EXPECT:10: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types
-// EXPECT:11: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types
-// EXPECT:12: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types
-// EXPECT:13: Warning: Test: invalid "transfer" annotation: only valid for container types
-// EXPECT:14: Warning: Test: invalid "transfer" annotation: only valid for object and interface types
+// EXPECT:10: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union, boxed, object and interface types
+// EXPECT:11: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union, boxed, object and interface types
+// EXPECT:12: Warning: Test: invalid "transfer" annotation for GType: only valid for array, struct, union, boxed, object and interface types
+// EXPECT:13: Warning: Test: invalid "transfer" annotation for Class('Object'): only valid for container types
+// EXPECT:14: Warning: Test: invalid "transfer" annotation for Record('DateTime'): only valid for object and interface types
/**
* test_transfer_return_invalid:
@@ -33,4 +33,4 @@ void test_transfer_invalid(GObject *param, GObject *param2, GObject *param3,
*/
char test_transfer_return_invalid (void);
-// EXPECT:32: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed, object and interface types
+// EXPECT:32: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union, boxed, object and interface types