diff options
author | Colin Walters <walters@verbum.org> | 2015-10-10 15:43:54 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-10-10 16:30:31 -0400 |
commit | 0aa60a43c4c9679668e15dbf3ef7a39016525150 (patch) | |
tree | 5c8143d00932e2b58f8af6399b2e2d58fcb33a58 /giscanner | |
parent | e8a7fbee3bb652159b81771ec16eab938ff84793 (diff) | |
download | gobject-introspection-0aa60a43c4c9679668e15dbf3ef7a39016525150.tar.gz |
maintransformer: Fix regression in callback closure assignment
The nullable code needs to search via index lookup of closure_name,
which drops the need to (incorrectly) assign closure_name again.
https://bugzilla.gnome.org/show_bug.cgi?id=756352
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/maintransformer.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 5ea1f5b4..b4b39345 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -1451,14 +1451,15 @@ method or constructor of some type.""" param.argname is not None and param.argname.endswith('data')): callback_param.closure_name = param.argname - param.closure_name = param.argname for param in params: # By convention, closure user_data parameters are always nullable. - if param.closure_name is not None and \ - param.closure_name == param.argname and \ - not param.not_nullable: - param.nullable = True + if param.closure_name is not None: + idx = node.get_parameter_index(param.closure_name) + assert idx >= 0 + closure_param = params[idx] + if not closure_param.not_nullable: + closure_param.nullable = True def _pass3_callable_throws(self, node): """Check to see if we have anything that looks like a |