After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641347 - add validation for (method) and (constructor) annotations
add validation for (method) and (constructor) annotations
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Tomeu Vizoso
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-02-03 14:10 UTC by Tomeu Vizoso
Modified: 2015-02-07 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add warnings for the (method) annotation (3.02 KB, patch)
2011-02-04 10:33 UTC, Tomeu Vizoso
none Details | Review
Add warnings for the (constructor) annotation (7.29 KB, patch)
2011-02-04 12:16 UTC, Tomeu Vizoso
none Details | Review
Add warnings for the (method) annotation (3.98 KB, patch)
2011-02-15 19:02 UTC, Tomeu Vizoso
committed Details | Review
Add warnings for the (constructor) annotation (8.10 KB, patch)
2011-02-15 19:03 UTC, Tomeu Vizoso
committed Details | Review

Description Tomeu Vizoso 2011-02-03 14:10:33 UTC
jdahlin: there a warning testing framework in test/warn which should be extended to cover these annotations
Comment 1 Tomeu Vizoso 2011-02-04 10:33:56 UTC
Created attachment 180061 [details] [review]
Add warnings for the (method) annotation
Comment 2 Tomeu Vizoso 2011-02-04 12:16:37 UTC
Created attachment 180073 [details] [review]
Add warnings for the (constructor) annotation

Applies on top of the previous patch
Comment 3 Tomeu Vizoso 2011-02-15 19:02:55 UTC
Created attachment 180935 [details] [review]
Add warnings for the (method) annotation
Comment 4 Tomeu Vizoso 2011-02-15 19:03:07 UTC
Created attachment 180936 [details] [review]
Add warnings for the (constructor) annotation
Comment 5 Johan (not receiving bugmail) Dahlin 2011-02-22 16:04:35 UTC
Review of attachment 180935 [details] [review]:

Looks great otherwise.

::: giscanner/maintransformer.py
@@ +932,3 @@
+                message.warn_node(func,
+                    '%s: Methods must belong to the same namespace as the '
+                    'class they are into' % (func.symbol, ))

as the class they belong to
Comment 6 Johan (not receiving bugmail) Dahlin 2011-02-22 16:05:57 UTC
Review of attachment 180936 [details] [review]:

Looks good otherwise.

::: giscanner/maintransformer.py
@@ +1052,3 @@
+            if func.is_constructor:
+                message.warn_node(func,
+                    '%s: Constructors must return an instance of their class' \

No need for the \

@@ +1073,3 @@
+                message.warn_node(func,
+                    '%s: Constructors must belong to the same namespace as the '
+                    'class they are into' % (func.symbol, ))

belongs to

::: tests/warn/invalid-constructor.h
@@ +7,3 @@
+int test_constructor_invalid_return();
+
+// EXPECT:7: Warning: Test: test_constructor_invalid_return: Constructors must return an instance of their class

Perhaps you could add ", not int" to the end, but that might be complicated to implement.
Comment 7 Tomeu Vizoso 2011-02-22 16:10:43 UTC
Comment on attachment 180935 [details] [review]
Add warnings for the (method) annotation

Attachment 180935 [details] pushed as a988cd4 - Add warnings for the (method) annotation
Comment 8 Tomeu Vizoso 2011-02-22 16:15:41 UTC
Attachment 180936 [details] pushed as c8e0405 - Add warnings for the (constructor) annotation
Comment 9 André Klapper 2015-02-07 16:44:41 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]