Codegen: parse synth property modifier

This commit is contained in:
Paolo Tranquilli
2023-05-23 15:36:32 +02:00
parent 165ac3eeaa
commit d2c9847a79
2 changed files with 17 additions and 1 deletions

View File

@@ -44,10 +44,15 @@ class _Namespace:
self.__dict__.update(kwargs)
class _SynthModifier(_schema.PropertyModifier, _Namespace):
def modify(self, prop: _schema.Property):
prop.synth = True
qltest = _Namespace()
ql = _Namespace()
cpp = _Namespace()
synth = _Namespace()
synth = _SynthModifier()
@_dataclass

View File

@@ -455,6 +455,17 @@ def test_ipa_class_hierarchy():
}
def test_synthesized_property():
@load
class data:
class A:
x: defs.int | defs.synth
assert data.classes["A"].properties == [
schema.SingleProperty("x", "int", synth=True)
]
def test_class_docstring():
@load
class data: