[gobject-introspection/ebassi/symbol-collision: 21/21] scanner: Mark colliding properties as not introspectable
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/ebassi/symbol-collision: 21/21] scanner: Mark colliding properties as not introspectable
- Date: Sat, 12 Feb 2022 11:09:55 +0000 (UTC)
commit 8e85d1ca937c166f07675d02fc84abb27d06ae11
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Aug 5 18:11:25 2021 +0100
scanner: Mark colliding properties as not introspectable
We prefer methods, signals, and virtual methods to properties, in case
of a collision.
giscanner/introspectablepass.py | 3 +++
.../Regress.TestObj-name-conflict.page | 18 ------------------
.../Regress.TestObj-name-conflict.page | 18 ------------------
tests/scanner/Regress-1.0-expected.gir | 1 +
4 files changed, 4 insertions(+), 36 deletions(-)
---
diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py
index e51c22b1..3bb6429a 100644
--- a/giscanner/introspectablepass.py
+++ b/giscanner/introspectablepass.py
@@ -272,6 +272,7 @@ class IntrospectablePass(object):
continue
if s.name.replace('-', '_') == prop.name.replace('-', '_'):
self._property_warning(obj, prop, "Properties cannot have the same name as signals")
+ prop.introspectable = False
return False
def _property_method_collision(self, obj, prop):
@@ -280,6 +281,7 @@ class IntrospectablePass(object):
continue
if m.name == prop.name.replace('-', '_'):
self._property_warning(obj, prop, "Properties cannot have the same name as methods")
+ prop.introspectable = False
return False
def _property_vfunc_collision(self, obj, prop):
@@ -288,6 +290,7 @@ class IntrospectablePass(object):
continue
if vfunc.name == prop.name.replace('-', '_'):
self._property_warning(obj, prop, "Properties cannot have the same name as virtual methods")
+ prop.introspectable = False
return False
def _introspectable_symbol_collisions(self, obj, stack):
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 99d68271..2374eb8e 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -4885,6 +4885,7 @@ raise an error.</doc>
</type>
</property>
<property name="name-conflict"
+ introspectable="0"
writable="1"
construct="1"
transfer-ownership="none">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]