summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorTorsten Schönfeld <kaffeetisch@gmx.de>2012-08-18 00:27:21 +0200
committerTorsten Schönfeld <kaffeetisch@gmx.de>2012-08-21 20:52:03 +0200
commitb0b4c98b31a23e6885b6c0785df93404b161b4b7 (patch)
tree5ab549951ea665416baaefa16f95b72175909009 /giscanner
parent0389b06d2dc800178d1e02446d0d6ce8d7c0bda4 (diff)
downloadgobject-introspection-b0b4c98b31a23e6885b6c0785df93404b161b4b7.tar.gz
scanner: methods cannot have an out-arg as their first arg
This ensures that if the first argument of a function like gboolean gdk_rgba_parse (GdkRGBA *rgba, const gchar *spec); is annotated as being an out-arg, the result is a class function with two arguments, not a method with one argument. Previously, the (out) annotation was simply ignored. https://bugzilla.gnome.org/show_bug.cgi?id=682124
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/maintransformer.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 77a66d21..d4163fae 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -1001,6 +1001,12 @@ method or constructor of some type."""
'%s: Methods must belong to the same namespace as the '
'class they belong to' % (func.symbol, ))
return False
+ if first.direction == ast.PARAM_DIRECTION_OUT:
+ if func.is_method:
+ message.warn_node(func,
+ '%s: The first argument of methods cannot be an '
+ 'out-argument' % (func.symbol, ))
+ return False
# A quick hack here...in the future we should catch C signature/GI signature
# mismatches in a general way in finaltransformer