mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Codegen: parse synth property modifier
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user