Codegen: improve implementation of generated parent/child relationship

This improves the implementation of the generated parent/child
relationship by adding a new `all_children` field to `ql.Class` which
lists all children (both direct and inherited) of a class, carefully
avoiding duplicating children in case of diamond inheritance. This:
* simplifies the generated code,
* avoid children ambiguities in case of diamond inheritance.

This only comes with some changes in the order of children in the
generated tests (we were previously sorting bases alphabetically there).
For the rest this should be a non-functional change.
This commit is contained in:
Paolo Tranquilli
2025-06-24 17:26:24 +02:00
parent c4a385fa6a
commit 1dcd60527c
19 changed files with 2120 additions and 5238 deletions

View File

@@ -30,6 +30,7 @@ import subprocess
import typing
import itertools
import os
import dataclasses
import inflection
@@ -113,117 +114,201 @@ def _get_doc(cls: schema.Class, prop: schema.Property, plural=None):
return f"{prop_name} of this {class_name}"
def _type_is_hideable(t: str, lookup: typing.Dict[str, schema.ClassBase]) -> bool:
if t in lookup:
match lookup[t]:
@dataclasses.dataclass
class Resolver:
lookup: typing.Dict[str, schema.ClassBase]
_property_cache: typing.Dict[tuple[int, int], ql.Property] = dataclasses.field(
default_factory=dict, init=False
)
_class_cache: typing.Dict[int, ql.Class] = dataclasses.field(
default_factory=dict, init=False
)
def _type_is_hideable(self, t: str) -> bool:
match self.lookup.get(t):
case schema.Class() as cls:
return "ql_hideable" in cls.pragmas
return False
case _:
return False
def get_ql_property(
self,
cls: schema.Class,
prop: schema.Property,
) -> ql.Property:
cache_key = (id(cls), id(prop))
if cache_key not in self._property_cache:
args = dict(
type=prop.type if not prop.is_predicate else "predicate",
qltest_skip="qltest_skip" in prop.pragmas,
is_optional=prop.is_optional,
is_predicate=prop.is_predicate,
is_unordered=prop.is_unordered,
description=prop.description,
synth=bool(cls.synth) or prop.synth,
type_is_hideable=self._type_is_hideable(prop.type),
type_is_codegen_class=prop.type in self.lookup
and not self.lookup[prop.type].imported,
internal="ql_internal" in prop.pragmas,
cfg=prop.is_child
and prop.type in self.lookup
and self.lookup[prop.type].cfg,
is_child=prop.is_child,
)
ql_name = prop.pragmas.get("ql_name", prop.name)
db_table_name = prop.pragmas.get("ql_db_table_name")
if db_table_name and prop.is_single:
raise Error(
f"`db_table_name` pragma is not supported for single properties, but {cls.name}.{prop.name} has it"
)
if prop.is_single:
args.update(
singular=inflection.camelize(ql_name),
tablename=inflection.tableize(cls.name),
tableparams=["this"]
+ [
"result" if p is prop else "_"
for p in cls.properties
if p.is_single
],
doc=_get_doc(cls, prop),
)
elif prop.is_repeated:
args.update(
singular=inflection.singularize(inflection.camelize(ql_name)),
plural=inflection.pluralize(inflection.camelize(ql_name)),
tablename=db_table_name
or inflection.tableize(f"{cls.name}_{prop.name}"),
tableparams=(
["this", "index", "result"]
if not prop.is_unordered
else ["this", "result"]
),
doc=_get_doc(cls, prop, plural=False),
doc_plural=_get_doc(cls, prop, plural=True),
)
elif prop.is_optional:
args.update(
singular=inflection.camelize(ql_name),
tablename=db_table_name
or inflection.tableize(f"{cls.name}_{prop.name}"),
tableparams=["this", "result"],
doc=_get_doc(cls, prop),
)
elif prop.is_predicate:
args.update(
singular=inflection.camelize(ql_name, uppercase_first_letter=False),
tablename=db_table_name
or inflection.underscore(f"{cls.name}_{prop.name}"),
tableparams=["this"],
doc=_get_doc(cls, prop),
)
else:
raise ValueError(
f"unknown property kind for {prop.name} from {cls.name}"
)
self._property_cache[cache_key] = ql.Property(**args)
return self._property_cache[cache_key]
def get_ql_property(
cls: schema.Class,
prop: schema.Property,
lookup: typing.Dict[str, schema.ClassBase],
prev_child: str = "",
) -> ql.Property:
def get_ql_class(self, cls: schema.Class) -> ql.Class:
cache_key = id(cls)
if cache_key not in self._class_cache:
if "ql_name" in cls.pragmas:
raise Error(
"ql_name is not supported yet for classes, only for properties"
)
properties = [self.get_ql_property(cls, p) for p in cls.properties]
all_children = [
ql.Child(self.get_ql_property(c, p))
for c, p in self._get_all_properties(cls)
if p.is_child
]
for prev, child in zip([""] + all_children, all_children):
child.prev = prev and prev.property.singular
self._class_cache[cache_key] = ql.Class(
name=cls.name,
bases=cls.bases,
bases_impl=[base + "Impl::" + base for base in cls.bases],
final=not cls.derived,
properties=properties,
all_children=all_children,
dir=pathlib.Path(cls.group or ""),
doc=cls.doc,
hideable="ql_hideable" in cls.pragmas,
internal="ql_internal" in cls.pragmas,
cfg=cls.cfg,
)
return self._class_cache[cache_key]
args = dict(
type=prop.type if not prop.is_predicate else "predicate",
qltest_skip="qltest_skip" in prop.pragmas,
prev_child=prev_child if prop.is_child else None,
is_optional=prop.is_optional,
is_predicate=prop.is_predicate,
is_unordered=prop.is_unordered,
description=prop.description,
synth=bool(cls.synth) or prop.synth,
type_is_hideable=_type_is_hideable(prop.type, lookup),
type_is_codegen_class=prop.type in lookup and not lookup[prop.type].imported,
internal="ql_internal" in prop.pragmas,
)
ql_name = prop.pragmas.get("ql_name", prop.name)
db_table_name = prop.pragmas.get("ql_db_table_name")
if db_table_name and prop.is_single:
raise Error(
f"`db_table_name` pragma is not supported for single properties, but {cls.name}.{prop.name} has it"
def get_ql_cfg_class(
self,
cls: schema.Class,
) -> ql.CfgClass:
return ql.CfgClass(
name=cls.name,
bases=[base for base in cls.bases if self.lookup[base.base].cfg],
properties=cls.properties,
doc=cls.doc,
)
if prop.is_single:
args.update(
singular=inflection.camelize(ql_name),
tablename=inflection.tableize(cls.name),
tableparams=["this"]
+ ["result" if p is prop else "_" for p in cls.properties if p.is_single],
doc=_get_doc(cls, prop),
)
elif prop.is_repeated:
args.update(
singular=inflection.singularize(inflection.camelize(ql_name)),
plural=inflection.pluralize(inflection.camelize(ql_name)),
tablename=db_table_name or inflection.tableize(f"{cls.name}_{prop.name}"),
tableparams=(
["this", "index", "result"]
if not prop.is_unordered
else ["this", "result"]
),
doc=_get_doc(cls, prop, plural=False),
doc_plural=_get_doc(cls, prop, plural=True),
)
elif prop.is_optional:
args.update(
singular=inflection.camelize(ql_name),
tablename=db_table_name or inflection.tableize(f"{cls.name}_{prop.name}"),
tableparams=["this", "result"],
doc=_get_doc(cls, prop),
)
elif prop.is_predicate:
args.update(
singular=inflection.camelize(ql_name, uppercase_first_letter=False),
tablename=db_table_name or inflection.underscore(f"{cls.name}_{prop.name}"),
tableparams=["this"],
doc=_get_doc(cls, prop),
)
else:
raise ValueError(f"unknown property kind for {prop.name} from {cls.name}")
return ql.Property(**args)
def _get_all_properties(
self,
cls: schema.Class,
already_seen: typing.Optional[typing.Set[int]] = None,
) -> typing.Iterable[typing.Tuple[schema.Class, schema.Property]]:
# deduplicate using ids
if already_seen is None:
already_seen = set()
for b in cls.bases:
base = self.lookup[b]
for item in self._get_all_properties(base, already_seen):
yield item
for p in cls.properties:
if id(p) not in already_seen:
already_seen.add(id(p))
yield cls, p
def get_ql_class(
cls: schema.Class, lookup: typing.Dict[str, schema.ClassBase]
) -> ql.Class:
if "ql_name" in cls.pragmas:
raise Error("ql_name is not supported yet for classes, only for properties")
prev_child = ""
properties = []
for p in cls.properties:
prop = get_ql_property(cls, p, lookup, prev_child)
if prop.is_child:
prev_child = prop.singular
if prop.type in lookup and lookup[prop.type].cfg:
prop.cfg = True
properties.append(prop)
return ql.Class(
name=cls.name,
bases=cls.bases,
bases_impl=[base + "Impl::" + base for base in cls.bases],
final=not cls.derived,
properties=properties,
dir=pathlib.Path(cls.group or ""),
doc=cls.doc,
hideable="ql_hideable" in cls.pragmas,
internal="ql_internal" in cls.pragmas,
cfg=cls.cfg,
)
def get_all_properties_to_be_tested(
self,
cls: schema.Class,
) -> typing.Iterable[ql.PropertyForTest]:
for c, p in self._get_all_properties(cls):
if not ("qltest_skip" in c.pragmas or "qltest_skip" in p.pragmas):
p = self.get_ql_property(c, p)
yield ql.PropertyForTest(
p.getter,
is_total=p.is_single or p.is_predicate,
type=p.type if not p.is_predicate else None,
is_indexed=p.is_indexed,
)
if p.is_repeated and not p.is_optional:
yield ql.PropertyForTest(f"getNumberOf{p.plural}", type="int")
elif p.is_optional and not p.is_repeated:
yield ql.PropertyForTest(f"has{p.singular}")
def _is_in_qltest_collapsed_hierarchy(
self,
cls: schema.Class,
) -> bool:
return (
"qltest_collapse_hierarchy" in cls.pragmas
or self._is_under_qltest_collapsed_hierarchy(cls)
)
def get_ql_cfg_class(
cls: schema.Class, lookup: typing.Dict[str, ql.Class]
) -> ql.CfgClass:
return ql.CfgClass(
name=cls.name,
bases=[base for base in cls.bases if lookup[base.base].cfg],
properties=cls.properties,
doc=cls.doc,
)
def _is_under_qltest_collapsed_hierarchy(
self,
cls: schema.Class,
) -> bool:
return "qltest_uncollapse_hierarchy" not in cls.pragmas and any(
self._is_in_qltest_collapsed_hierarchy(self.lookup[b]) for b in cls.bases
)
def should_skip_qltest(self, cls: schema.Class) -> bool:
return (
"qltest_skip" in cls.pragmas
or not (cls.final or "qltest_collapse_hierarchy" in cls.pragmas)
or self._is_under_qltest_collapsed_hierarchy(cls)
)
def _to_db_type(x: str) -> str:
@@ -330,43 +415,6 @@ def _get_path_public(cls: schema.Class) -> pathlib.Path:
).with_suffix(".qll")
def _get_all_properties(
cls: schema.Class,
lookup: typing.Dict[str, schema.Class],
already_seen: typing.Optional[typing.Set[int]] = None,
) -> typing.Iterable[typing.Tuple[schema.Class, schema.Property]]:
# deduplicate using ids
if already_seen is None:
already_seen = set()
for b in sorted(cls.bases):
base = lookup[b]
for item in _get_all_properties(base, lookup, already_seen):
yield item
for p in cls.properties:
if id(p) not in already_seen:
already_seen.add(id(p))
yield cls, p
def _get_all_properties_to_be_tested(
cls: schema.Class, lookup: typing.Dict[str, schema.Class]
) -> typing.Iterable[ql.PropertyForTest]:
for c, p in _get_all_properties(cls, lookup):
if not ("qltest_skip" in c.pragmas or "qltest_skip" in p.pragmas):
# TODO here operations are duplicated, but should be better if we split ql and qltest generation
p = get_ql_property(c, p, lookup)
yield ql.PropertyForTest(
p.getter,
is_total=p.is_single or p.is_predicate,
type=p.type if not p.is_predicate else None,
is_indexed=p.is_indexed,
)
if p.is_repeated and not p.is_optional:
yield ql.PropertyForTest(f"getNumberOf{p.plural}", type="int")
elif p.is_optional and not p.is_repeated:
yield ql.PropertyForTest(f"has{p.singular}")
def _partition_iter(x, pred):
x1, x2 = itertools.tee(x)
return filter(pred, x1), itertools.filterfalse(pred, x2)
@@ -377,31 +425,6 @@ def _partition(l, pred):
return map(list, _partition_iter(l, pred))
def _is_in_qltest_collapsed_hierarchy(
cls: schema.Class, lookup: typing.Dict[str, schema.Class]
):
return (
"qltest_collapse_hierarchy" in cls.pragmas
or _is_under_qltest_collapsed_hierarchy(cls, lookup)
)
def _is_under_qltest_collapsed_hierarchy(
cls: schema.Class, lookup: typing.Dict[str, schema.Class]
):
return "qltest_uncollapse_hierarchy" not in cls.pragmas and any(
_is_in_qltest_collapsed_hierarchy(lookup[b], lookup) for b in cls.bases
)
def should_skip_qltest(cls: schema.Class, lookup: typing.Dict[str, schema.Class]):
return (
"qltest_skip" in cls.pragmas
or not (cls.final or "qltest_collapse_hierarchy" in cls.pragmas)
or _is_under_qltest_collapsed_hierarchy(cls, lookup)
)
def _get_stub(
cls: schema.Class, base_import: str, generated_import_prefix: str
) -> ql.Stub:
@@ -487,8 +510,10 @@ def generate(opts, renderer):
data = schemaloader.load_file(input)
resolver = Resolver(data.classes)
classes = {
name: get_ql_class(cls, data.classes)
name: resolver.get_ql_class(cls)
for name, cls in data.classes.items()
if not cls.imported
}
@@ -538,7 +563,7 @@ def generate(opts, renderer):
)
imports_impl[c.name + "Impl"] = path_impl + "Impl"
if c.cfg:
cfg_classes.append(get_ql_cfg_class(c, classes))
cfg_classes.append(resolver.get_ql_cfg_class(c))
for c in classes.values():
qll = out / c.path.with_suffix(".qll")
@@ -609,7 +634,7 @@ def generate(opts, renderer):
for c in data.classes.values():
if c.imported:
continue
if should_skip_qltest(c, data.classes):
if resolver.should_skip_qltest(c):
continue
test_with_name = c.pragmas.get("qltest_test_with")
test_with = data.classes[test_with_name] if test_with_name else c
@@ -626,7 +651,7 @@ def generate(opts, renderer):
)
continue
total_props, partial_props = _partition(
_get_all_properties_to_be_tested(c, data.classes),
resolver.get_all_properties_to_be_tested(c),
lambda p: p.is_total,
)
renderer.render(

View File

@@ -59,13 +59,12 @@ def generate(opts, renderer):
registry=opts.ql_test_output / ".generated_tests.list",
force=opts.force,
) as renderer:
resolver = qlgen.Resolver(schema.classes)
for cls in schema.classes.values():
if cls.imported:
continue
if (
qlgen.should_skip_qltest(cls, schema.classes)
or "rust_skip_doc_test" in cls.pragmas
):
if resolver.should_skip_qltest(cls) or "rust_skip_doc_test" in cls.pragmas:
continue
code = _get_code(cls.doc)
for p in schema.iter_properties(cls.name):

View File

@@ -37,7 +37,6 @@ class Property:
is_optional: bool = False
is_predicate: bool = False
is_unordered: bool = False
prev_child: Optional[str] = None
qltest_skip: bool = False
description: List[str] = field(default_factory=list)
doc: Optional[str] = None
@@ -48,6 +47,7 @@ class Property:
type_is_self: bool = False
internal: bool = False
cfg: bool = False
is_child: bool = False
def __post_init__(self):
if self.tableparams:
@@ -76,10 +76,6 @@ class Property:
def is_single(self):
return not (self.is_optional or self.is_repeated or self.is_predicate)
@property
def is_child(self):
return self.prev_child is not None
@property
def is_indexed(self) -> bool:
return self.is_repeated and not self.is_unordered
@@ -89,6 +85,12 @@ class Property:
return self.type + "Alias" if self.type_is_self else self.type
@dataclass
class Child:
property: Property
prev: str = ""
@dataclass
class Base:
base: str
@@ -107,6 +109,7 @@ class Class:
bases_impl: List[Base] = field(default_factory=list)
final: bool = False
properties: List[Property] = field(default_factory=list)
all_children: List[Child] = field(default_factory=list)
dir: pathlib.Path = pathlib.Path()
imports: List[str] = field(default_factory=list)
import_prefix: Optional[str] = None
@@ -148,7 +151,7 @@ class Class:
@property
def has_children(self) -> bool:
return any(p.is_child for p in self.properties)
return bool(self.all_children)
@property
def last_base(self) -> str:

View File

@@ -9,51 +9,39 @@ import {{.}}
private module Impl {
{{#classes}}
private Element getImmediateChildOf{{name}}({{name}} e, int index, string partialPredicateCall) {
{{! avoid unused argument warnings on root element, assuming the root element has no children }}
{{#root}}none(){{/root}}
{{^root}}
{{! b is the base offset 0, for ease of generation }}
{{! b<base> is constructed to be strictly greater than the indexes required for children coming from <base> }}
{{! n is the base offset for direct children, equal to the last base offset from above }}
{{! n<child> is constructed to be strictly greater than the indexes for <child> children }}
exists(int b{{#bases}}, int b{{.}}{{/bases}}, int n{{#properties}}{{#is_child}}, int n{{singular}}{{/is_child}}{{/properties}} |
b = 0
{{#bases}}
and
b{{.}} = b{{prev}} + 1 + max(int i | i = -1 or exists(getImmediateChildOf{{.}}(e, i, _)) | i)
{{/bases}}
and
n = b{{last_base}}
{{#properties}}
{{#is_child}}
{{! n<child> is defined on top of the previous definition }}
{{! for single and optional properties it adds 1 (regardless of whether the optional property exists) }}
{{! for repeated it adds 1 + the maximum index (which works for repeated optional as well) }}
and
n{{singular}} = n{{prev_child}} + 1{{#is_repeated}}+ max(int i | i = -1 or exists(e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}(i)) | i){{/is_repeated}}
{{/is_child}}
{{/properties}} and (
none()
{{#bases}}
or
result = getImmediateChildOf{{.}}(e, index - b{{prev}}, partialPredicateCall)
{{/bases}}
{{#properties}}
{{#is_child}}
or
{{#is_repeated}}
result = e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}(index - n{{prev_child}}) and partialPredicateCall = "{{singular}}(" + (index - n{{prev_child}}).toString() + ")"
{{/is_repeated}}
{{^is_repeated}}
index = n{{prev_child}} and result = e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}() and partialPredicateCall = "{{singular}}()"
{{/is_repeated}}
{{/is_child}}
{{/properties}}
))
{{/root}}
}
{{#final}}
private Element getImmediateChildOf{{name}}({{name}} e, int index, string partialPredicateCall) {
{{^has_children}}none(){{/has_children}}
{{#has_children}}
{{! n is the base offset 0, for ease of generation }}
{{! n<child> is constructed to be strictly greater than the indexes for <child> children }}
exists(int n{{#all_children}}, int n{{property.singular}}{{/all_children}} |
n = 0
{{#all_children}}
{{#property}}
{{! n<child> is defined on top of the previous definition }}
{{! for single and optional properties it adds 1 (regardless of whether the optional property exists) }}
{{! for repeated it adds 1 + the maximum index (which works for repeated optional as well) }}
and
n{{singular}} = n{{prev}} + 1{{#is_repeated}}+ max(int i | i = -1 or exists(e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}(i)) | i){{/is_repeated}}
{{/property}}
{{/all_children}} and (
none()
{{#all_children}}
{{#property}}
or
{{#is_repeated}}
result = e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}(index - n{{prev}}) and partialPredicateCall = "{{singular}}(" + (index - n{{prev}}).toString() + ")"
{{/is_repeated}}
{{^is_repeated}}
index = n{{prev}} and result = e.get{{#type_is_hideable}}Immediate{{/type_is_hideable}}{{singular}}() and partialPredicateCall = "{{singular}}()"
{{/is_repeated}}
{{/property}}
{{/all_children}}
))
{{/has_children}}
}
{{/final}}
{{/classes}}
cached
Element getImmediateChild(Element e, int index, string partialAccessor) {

View File

@@ -133,22 +133,10 @@ def test_non_root_class():
assert not cls.root
@pytest.mark.parametrize(
"prev_child,is_child", [(None, False), ("", True), ("x", True)]
)
def test_is_child(prev_child, is_child):
p = ql.Property("Foo", "int", prev_child=prev_child)
assert p.is_child is is_child
def test_empty_class_no_children():
cls = ql.Class("Class", properties=[])
assert cls.has_children is False
def test_class_no_children():
cls = ql.Class(
"Class", properties=[ql.Property("Foo", "int"), ql.Property("Bar", "string")]
"Class",
all_children=[],
)
assert cls.has_children is False
@@ -156,11 +144,7 @@ def test_class_no_children():
def test_class_with_children():
cls = ql.Class(
"Class",
properties=[
ql.Property("Foo", "int"),
ql.Property("Child", "x", prev_child=""),
ql.Property("Bar", "string"),
],
all_children=[ql.Child(ql.Property("Foo", "int"))],
)
assert cls.has_children is True

View File

@@ -388,11 +388,101 @@ def test_internal_property(generate_classes):
def test_children(generate_classes):
expected_parent_property = ql.Property(
singular="ParentChild",
type="int",
is_child=True,
tablename="parents",
tableparams=["this", "result"],
doc="parent child of this parent",
)
expected_properties = [
ql.Property(
singular="A",
type="int",
tablename="my_objects",
tableparams=["this", "result", "_"],
doc="a of this my object",
),
ql.Property(
singular="Child1",
type="int",
tablename="my_objects",
tableparams=["this", "_", "result"],
is_child=True,
doc="child 1 of this my object",
),
ql.Property(
singular="B",
plural="Bs",
type="int",
tablename="my_object_bs",
tableparams=["this", "index", "result"],
doc="b of this my object",
doc_plural="bs of this my object",
),
ql.Property(
singular="Child",
plural="Children",
type="int",
tablename="my_object_children",
tableparams=["this", "index", "result"],
is_child=True,
doc="child of this my object",
doc_plural="children of this my object",
),
ql.Property(
singular="C",
type="int",
tablename="my_object_cs",
tableparams=["this", "result"],
is_optional=True,
doc="c of this my object",
),
ql.Property(
singular="Child3",
type="int",
tablename="my_object_child_3s",
tableparams=["this", "result"],
is_optional=True,
is_child=True,
doc="child 3 of this my object",
),
ql.Property(
singular="D",
plural="Ds",
type="int",
tablename="my_object_ds",
tableparams=["this", "index", "result"],
is_optional=True,
doc="d of this my object",
doc_plural="ds of this my object",
),
ql.Property(
singular="Child4",
plural="Child4s",
type="int",
tablename="my_object_child_4s",
tableparams=["this", "index", "result"],
is_optional=True,
is_child=True,
doc="child 4 of this my object",
doc_plural="child 4s of this my object",
),
]
assert generate_classes(
[
schema.Class("FakeRoot"),
schema.Class(
"Parent",
derived={"MyObject"},
properties=[
schema.SingleProperty("parent_child", "int", is_child=True),
],
),
schema.Class(
"MyObject",
bases=["Parent"],
properties=[
schema.SingleProperty("a", "int"),
schema.SingleProperty("child_1", "int", is_child=True),
@@ -413,87 +503,53 @@ def test_children(generate_classes):
name="FakeRoot", final=True, imports=[stub_import_prefix + "FakeRoot"]
),
),
"Parent.qll": (
a_ql_class_public(name="Parent"),
a_ql_stub(name="Parent"),
a_ql_class(
name="Parent",
imports=[stub_import_prefix + "Parent"],
properties=[expected_parent_property],
all_children=[
ql.Child(
expected_parent_property,
),
],
),
),
"MyObject.qll": (
a_ql_class_public(name="MyObject"),
a_ql_class_public(name="MyObject", imports=[stub_import_prefix + "Parent"]),
a_ql_stub(name="MyObject"),
a_ql_class(
name="MyObject",
final=True,
properties=[
ql.Property(
singular="A",
type="int",
tablename="my_objects",
tableparams=["this", "result", "_"],
doc="a of this my object",
bases=["Parent"],
bases_impl=["ParentImpl::Parent"],
properties=expected_properties,
all_children=[
ql.Child(
expected_parent_property,
),
ql.Property(
singular="Child1",
type="int",
tablename="my_objects",
tableparams=["this", "_", "result"],
prev_child="",
doc="child 1 of this my object",
ql.Child(
expected_properties[1],
prev="ParentChild",
),
ql.Property(
singular="B",
plural="Bs",
type="int",
tablename="my_object_bs",
tableparams=["this", "index", "result"],
doc="b of this my object",
doc_plural="bs of this my object",
ql.Child(
expected_properties[3],
prev="Child1",
),
ql.Property(
singular="Child",
plural="Children",
type="int",
tablename="my_object_children",
tableparams=["this", "index", "result"],
prev_child="Child1",
doc="child of this my object",
doc_plural="children of this my object",
ql.Child(
expected_properties[5],
prev="Child",
),
ql.Property(
singular="C",
type="int",
tablename="my_object_cs",
tableparams=["this", "result"],
is_optional=True,
doc="c of this my object",
),
ql.Property(
singular="Child3",
type="int",
tablename="my_object_child_3s",
tableparams=["this", "result"],
is_optional=True,
prev_child="Child",
doc="child 3 of this my object",
),
ql.Property(
singular="D",
plural="Ds",
type="int",
tablename="my_object_ds",
tableparams=["this", "index", "result"],
is_optional=True,
doc="d of this my object",
doc_plural="ds of this my object",
),
ql.Property(
singular="Child4",
plural="Child4s",
type="int",
tablename="my_object_child_4s",
tableparams=["this", "index", "result"],
is_optional=True,
prev_child="Child3",
doc="child 4 of this my object",
doc_plural="child 4s of this my object",
ql.Child(
expected_properties[7],
prev="Child3",
),
],
imports=[stub_import_prefix + "MyObject"],
imports=[
stub_import_prefix + "internal.ParentImpl::Impl as ParentImpl"
],
),
),
}
@@ -547,14 +603,13 @@ def test_single_properties(generate_classes):
}
@pytest.mark.parametrize("is_child,prev_child", [(False, None), (True, "")])
def test_optional_property(generate_classes, is_child, prev_child):
def test_optional_property(generate_classes):
assert generate_classes(
[
schema.Class("FakeRoot"),
schema.Class(
"MyObject",
properties=[schema.OptionalProperty("foo", "bar", is_child=is_child)],
properties=[schema.OptionalProperty("foo", "bar")],
),
]
) == {
@@ -578,7 +633,6 @@ def test_optional_property(generate_classes, is_child, prev_child):
tablename="my_object_foos",
tableparams=["this", "result"],
is_optional=True,
prev_child=prev_child,
doc="foo of this my object",
),
],
@@ -588,14 +642,13 @@ def test_optional_property(generate_classes, is_child, prev_child):
}
@pytest.mark.parametrize("is_child,prev_child", [(False, None), (True, "")])
def test_repeated_property(generate_classes, is_child, prev_child):
def test_repeated_property(generate_classes):
assert generate_classes(
[
schema.Class("FakeRoot"),
schema.Class(
"MyObject",
properties=[schema.RepeatedProperty("foo", "bar", is_child=is_child)],
properties=[schema.RepeatedProperty("foo", "bar")],
),
]
) == {
@@ -619,7 +672,6 @@ def test_repeated_property(generate_classes, is_child, prev_child):
type="bar",
tablename="my_object_foos",
tableparams=["this", "index", "result"],
prev_child=prev_child,
doc="foo of this my object",
doc_plural="foos of this my object",
),
@@ -670,16 +722,13 @@ def test_repeated_unordered_property(generate_classes):
}
@pytest.mark.parametrize("is_child,prev_child", [(False, None), (True, "")])
def test_repeated_optional_property(generate_classes, is_child, prev_child):
def test_repeated_optional_property(generate_classes):
assert generate_classes(
[
schema.Class("FakeRoot"),
schema.Class(
"MyObject",
properties=[
schema.RepeatedOptionalProperty("foo", "bar", is_child=is_child)
],
properties=[schema.RepeatedOptionalProperty("foo", "bar")],
),
]
) == {
@@ -704,7 +753,6 @@ def test_repeated_optional_property(generate_classes, is_child, prev_child):
tablename="my_object_foos",
tableparams=["this", "index", "result"],
is_optional=True,
prev_child=prev_child,
doc="foo of this my object",
doc_plural="foos of this my object",
),
@@ -743,14 +791,13 @@ def test_predicate_property(generate_classes):
}
@pytest.mark.parametrize("is_child,prev_child", [(False, None), (True, "")])
def test_single_class_property(generate_classes, is_child, prev_child):
def test_single_class_property(generate_classes):
assert generate_classes(
[
schema.Class("Bar"),
schema.Class(
"MyObject",
properties=[schema.SingleProperty("foo", "Bar", is_child=is_child)],
properties=[schema.SingleProperty("foo", "Bar")],
),
]
) == {
@@ -767,7 +814,6 @@ def test_single_class_property(generate_classes, is_child, prev_child):
type="Bar",
tablename="my_objects",
tableparams=["this", "result"],
prev_child=prev_child,
doc="foo of this my object",
type_is_codegen_class=True,
),

View File

@@ -578,7 +578,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll eaa0cd4402d3665013d47e
lib/codeql/rust/elements/internal/generated/ParenExpr.qll 812d2ff65079277f39f15c084657a955a960a7c1c0e96dd60472a58d56b945eb eb8c607f43e1fcbb41f37a10de203a1db806690e10ff4f04d48ed874189cb0eb
lib/codeql/rust/elements/internal/generated/ParenPat.qll 24f9dc7fce75827d6fddb856cd48f80168143151b27295c0bab6db5a06567a09 ebadbc6f5498e9ed754b39893ce0763840409a0721036a25b56e1ead7dcc09aa
lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 03f5c5b96a37adeb845352d7fcea3e098da9050e534972d14ac0f70d60a2d776 ed3d6e5d02086523087adebce4e89e35461eb95f2a66d1d4100fe23fc691b126
lib/codeql/rust/elements/internal/generated/ParentChild.qll 24db280d50c02a657a862626ea611a6fa8dab2e03aa4fd86fb61dd69032df333 2b1b2da55bd6f8fe30192afb83843eebd24c9b3e2561a714da4977bccb4ef6cc
lib/codeql/rust/elements/internal/generated/ParentChild.qll ff51da9dd3d1f739057f764f46244fb361c950bf7d1f61007e33d92581ec45e1 bebe239202e79d5a31e29f42f5e9d88139cf07e0fb2541fdd95b8e65154d2776
lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll d901fdc8142a5b8847cc98fc2afcfd16428b8ace4fbffb457e761b5fd3901a77 5dbb0aea5a13f937da666ccb042494af8f11e776ade1459d16b70a4dd193f9fb
lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4
lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd
@@ -837,7 +837,7 @@ test/extractor-tests/generated/FormatArgsExpr/FormatTemplateVariableAccess.ql 27
test/extractor-tests/generated/FormatArgsExpr/Format_getArgumentRef.ql 634efdffaae4199aa9d95652cf081a8dc26e88224e24678845f8a67dc24ce090 d0302fee5c50403214771d5c6b896ba7c6e52be10c9bea59720ef2bb954e6f40
test/extractor-tests/generated/FormatArgsExpr/Format_getPrecisionArgument.ql 0d2140f84d0220b0c72c48c6bd272f4cfe1863d1797eddd16a6e238552a61e4d f4fe9b29697041e30764fa3dea44f125546bfb648f32c3474a1e922a4255c534
test/extractor-tests/generated/FormatArgsExpr/Format_getWidthArgument.ql 01ef27dd0bfab273e1ddc57ada0e079ece8a2bfd195ce413261006964b444093 acd0161f86010759417015c5b58044467a7f760f288ec4e8525458c54ae9a715
test/extractor-tests/generated/Function/Function.ql 66e6a81a80cdf30652f00fae1b060e93b9d7c61b08cb3d3c1cac16cad445e769 97ace9f51b9ae933c79484b06b92355164ff3582cadfc6e3bac5c00072cdeff3
test/extractor-tests/generated/Function/Function.ql 01f0fdcd989648d7d648b3af617e296529c7c674d6bb0977d37306377ae75774 08fd3f595e05e24742f52a474a74b09753a9b565aedffdf4e727d58cc659c97f
test/extractor-tests/generated/Function/Function_getAbi.ql e5c9c97de036ddd51cae5d99d41847c35c6b2eabbbd145f4467cb501edc606d8 0b81511528bd0ef9e63b19edfc3cb638d8af43eb87d018fad69d6ef8f8221454
test/extractor-tests/generated/Function/Function_getAttr.ql 44067ee11bdec8e91774ff10de0704a8c5c1b60816d587378e86bf3d82e1f660 b4bebf9441bda1f2d1e34e9261e07a7468cbabf53cf8047384f3c8b11869f04e
test/extractor-tests/generated/Function/Function_getAttributeMacroExpansion.ql 17a346a9e5d28af99522520d1af3852db4cae01fb3d290a65c5f84d8d039c345 36fb06b55370828d9bc379cf5fad7f383cdb6f6db6f7377660276943ab0e1ec8

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "test"
version = "0.0.1"

View File

@@ -1,2 +1,2 @@
| gen_function.rs:3:1:4:38 | fn foo | hasParamList: | yes | getNumberOfAttrs: | 0 | getNumberOfParams: | 1 | hasExtendedCanonicalPath: | yes | hasCrateOrigin: | yes | hasAttributeMacroExpansion: | no | hasAbi: | no | hasBody: | yes | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasRetType: | yes | hasVisibility: | no | hasWhereClause: | no | hasImplementation: | yes |
| gen_function.rs:7:5:7:13 | fn bar | hasParamList: | yes | getNumberOfAttrs: | 0 | getNumberOfParams: | 0 | hasExtendedCanonicalPath: | yes | hasCrateOrigin: | yes | hasAttributeMacroExpansion: | no | hasAbi: | no | hasBody: | no | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasRetType: | no | hasVisibility: | no | hasWhereClause: | no | hasImplementation: | no |
| gen_function.rs:3:1:4:38 | fn foo | hasExtendedCanonicalPath: | yes | hasCrateOrigin: | yes | hasAttributeMacroExpansion: | no | hasParamList: | yes | getNumberOfAttrs: | 0 | getNumberOfParams: | 1 | hasAbi: | no | hasBody: | yes | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasRetType: | yes | hasVisibility: | no | hasWhereClause: | no | hasImplementation: | yes |
| gen_function.rs:7:5:7:13 | fn bar | hasExtendedCanonicalPath: | yes | hasCrateOrigin: | yes | hasAttributeMacroExpansion: | no | hasParamList: | yes | getNumberOfAttrs: | 0 | getNumberOfParams: | 0 | hasAbi: | no | hasBody: | no | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasRetType: | no | hasVisibility: | no | hasWhereClause: | no | hasImplementation: | no |

View File

@@ -3,17 +3,14 @@ import codeql.rust.elements
import TestUtils
from
Function x, string hasParamList, int getNumberOfAttrs, int getNumberOfParams,
string hasExtendedCanonicalPath, string hasCrateOrigin, string hasAttributeMacroExpansion,
string hasAbi, string hasBody, string hasGenericParamList, string isAsync, string isConst,
string isDefault, string isGen, string isUnsafe, string hasName, string hasRetType,
string hasVisibility, string hasWhereClause, string hasImplementation
Function x, string hasExtendedCanonicalPath, string hasCrateOrigin,
string hasAttributeMacroExpansion, string hasParamList, int getNumberOfAttrs,
int getNumberOfParams, string hasAbi, string hasBody, string hasGenericParamList, string isAsync,
string isConst, string isDefault, string isGen, string isUnsafe, string hasName,
string hasRetType, string hasVisibility, string hasWhereClause, string hasImplementation
where
toBeTested(x) and
not x.isUnknown() and
(if x.hasParamList() then hasParamList = "yes" else hasParamList = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
getNumberOfParams = x.getNumberOfParams() and
(
if x.hasExtendedCanonicalPath()
then hasExtendedCanonicalPath = "yes"
@@ -25,6 +22,9 @@ where
then hasAttributeMacroExpansion = "yes"
else hasAttributeMacroExpansion = "no"
) and
(if x.hasParamList() then hasParamList = "yes" else hasParamList = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
getNumberOfParams = x.getNumberOfParams() and
(if x.hasAbi() then hasAbi = "yes" else hasAbi = "no") and
(if x.hasBody() then hasBody = "yes" else hasBody = "no") and
(if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and
@@ -38,10 +38,10 @@ where
(if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and
(if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no") and
if x.hasImplementation() then hasImplementation = "yes" else hasImplementation = "no"
select x, "hasParamList:", hasParamList, "getNumberOfAttrs:", getNumberOfAttrs,
"getNumberOfParams:", getNumberOfParams, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath,
"hasCrateOrigin:", hasCrateOrigin, "hasAttributeMacroExpansion:", hasAttributeMacroExpansion,
"hasAbi:", hasAbi, "hasBody:", hasBody, "hasGenericParamList:", hasGenericParamList, "isAsync:",
isAsync, "isConst:", isConst, "isDefault:", isDefault, "isGen:", isGen, "isUnsafe:", isUnsafe,
"hasName:", hasName, "hasRetType:", hasRetType, "hasVisibility:", hasVisibility,
"hasWhereClause:", hasWhereClause, "hasImplementation:", hasImplementation
select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin,
"hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "hasParamList:", hasParamList,
"getNumberOfAttrs:", getNumberOfAttrs, "getNumberOfParams:", getNumberOfParams, "hasAbi:", hasAbi,
"hasBody:", hasBody, "hasGenericParamList:", hasGenericParamList, "isAsync:", isAsync, "isConst:",
isConst, "isDefault:", isDefault, "isGen:", isGen, "isUnsafe:", isUnsafe, "hasName:", hasName,
"hasRetType:", hasRetType, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause,
"hasImplementation:", hasImplementation

View File

@@ -733,7 +733,7 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd
lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa
lib/codeql/swift/generated/MacroRole.qll facf907e75490d69cd401c491215e4719324d751f40ea46c86ccf24cf3663c1f 969d8d4b44e3f1a9c193a152a4d83a303e56d2dbb871fc920c47a33f699cf018
lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f
lib/codeql/swift/generated/ParentChild.qll d66e5c28e93a3085fbae0ada238a96577ad21fd64a37ce967032bf5df8bdfb1d 2d440ad9c0304f658d54c6c53a8b1db1d3e032ee5522b51c46116413d0cf5dbb
lib/codeql/swift/generated/ParentChild.qll 86a6c9ba4c79d72bf7a0786274f6fba49e6f37cf82de0451a6dad0d319224ebd f7b99ceb052a23d7c25d1615d1453d421b5ddddcec60b7d8d6f956d0d3fd7a2d
lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec
lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4
lib/codeql/swift/generated/Raw.qll 96d5f8778f25cd396b5cc56c38dce597c5a9a5c2b1e9ed8b9a4d2eca89e49323 d65072b5c508dad1dd813e19f7431087d8bfc0e5d85aa3d19beffbcbbec585ec
@@ -1043,7 +1043,7 @@ test/extractor-tests/generated/KeyPathComponent/KeyPathComponent_getSubscriptArg
test/extractor-tests/generated/KeyPathComponent/KeyPathComponent_getTupleIndex.ql c55da7366086c0a927e23fbaf5cb2ebab50ac4eafde206b59efad96edd0545ff dc1cd851d68fd307a1f101a4cd94ec971475bdd2b26fb82a8566b4a99d0aa505
test/extractor-tests/generated/OtherAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/PlatformVersionAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/decl/Accessor/Accessor.ql fb3e3b8096ed6f9de299f73383194520bcd0a96f4e215e1945456e0c2beaa2a0 cc66788194840b4c5c57e9cbd8f7072655fa9947f2da36cf9f59463ea070d409
test/extractor-tests/generated/decl/Accessor/Accessor.ql 60bcf87ed351242567504396baf88eb041d21f16564ed64a67aa0b3ed0d148d8 74687e423971ec7055aba12b5a58a4bae3ddf51ea17f83f7a142cbca6c48d309
test/extractor-tests/generated/decl/Accessor/Accessor_getBody.ql 89660097038fe210b72373ed6ea4d6e6cc6505a45d8e0892b53e265bb1d2c398 9abec75977ca2f5328ff6730b3b40c264cc385961c2685351c869a359c5afeb4
test/extractor-tests/generated/decl/Accessor/Accessor_getCapture.ql 15011012186c6111d5eace2f5ad34747adaa5e84d044a98bb7da17b08695c69d 60411e7886e5cfc211c10881b6e061e02597690eccd714fff2a51874e4088d27
test/extractor-tests/generated/decl/Accessor/Accessor_getGenericTypeParam.ql 92b13b69f0b64abd16eecbf38eae4ff1a7006617639b80c0f22b651caeb40da6 06113682dda3ff88688b6689953e21b0b8ead5d019fc56ff7752b19b46711a4d
@@ -1081,7 +1081,7 @@ test/extractor-tests/generated/decl/EnumDecl/EnumDecl_getMember.ql 5a4de48886bd8
test/extractor-tests/generated/decl/EnumDecl/EnumElementDecl.ql bd00c56cf1d05707f29c4f31defc6a3ff25f41928688c2be992a92d4c5624859 3bd69b639f883e164fa6d1d4a3ad18aed86f88b93358636c5e118f1ca96eb878
test/extractor-tests/generated/decl/EnumDecl/EnumElementDecl_getMember.ql e40260a5689d26c9bf2dfe17617e8a1480c720523e47f50273aeb7160a69f244 7ee294373de5bd22fc2c64a7acae4a94e9bdebf808c8e73a16a57b0dc3c295ac
test/extractor-tests/generated/decl/EnumDecl/EnumElementDecl_getParam.ql a507e55efcc13544d93c91c343a3df14b79114f259cb4dbec56d6f56e804d4e8 587bf774b4c4451ff873506624ccd379dd2fd7689460b4e24af96fbccadc0e6d
test/extractor-tests/generated/decl/ExtensionDecl/ExtensionDecl.ql 11a15a67f7b19e3d1fb5a2616420c23fde400848c8dbfcadb8e52a40130b92ad 502831fd3465ff06eba1dc6be365bee5fc2fcec96be44967a6579bbbdd395a32
test/extractor-tests/generated/decl/ExtensionDecl/ExtensionDecl.ql be2fa0832e1d01c2f4c0ac09fb1075166b05d19fa46828f10e81d9ca4aac3033 b5bc89103f2f04964a8e66835f81a52184e9d890f80ba27c8aef5bfcf65daee7
test/extractor-tests/generated/decl/ExtensionDecl/ExtensionDecl_getGenericTypeParam.ql bc57c794b106df3b9da47432ef3241849145d5e86ebf601cec08729f05e15956 bce4e2150ca2efe495e544a3a074c7ebc81f68bd2f3280a76f565d31acb091e2
test/extractor-tests/generated/decl/ExtensionDecl/ExtensionDecl_getMember.ql 0883fcc244e06329738f242a36d0c33ee5228500e8f9d4508e4b5b32d863edfe 4fa99729397085d19b25415ed40e62dc2a555d7581c6c98895e635f7d502689b
test/extractor-tests/generated/decl/ExtensionDecl/ExtensionDecl_getProtocol.ql 040731ade8fb6cfe989fb62874c405a24256ca3947251d6799c8f53e144d2ce9 d5b37f663a19fba137735b85c070405d687d3e84c1850d93f43b50f77524357f
@@ -1108,7 +1108,7 @@ test/extractor-tests/generated/decl/ModuleDecl/ModuleDecl_getAnExportedModule.ql
test/extractor-tests/generated/decl/ModuleDecl/ModuleDecl_getAnImportedModule.ql d85c12bc7fe2732594ca27cf85de1649ab3ecb64c49439b48a18353386e250ea ed58651f5d1c767dcb17a679a780d4248d5de779d7fb1ffff13675867071ef6f
test/extractor-tests/generated/decl/ModuleDecl/ModuleDecl_getInheritedType.ql 624711472413d1bbcdcd01a805667bdebce7f4959f39016a5b4df60610eed019 e30f3e09e160784ae6170e05075b10cc03df7d3e44b9647be193abd7733e19e9
test/extractor-tests/generated/decl/ModuleDecl/ModuleDecl_getMember.ql 2e6fad621c4a301b124336977ba5a6489e143d37e33deb330b993a06bf263069 c4622cd12ecf94fa1e413413ee3e5d38625d8c8ea6694473baf6b6e05d222ad9
test/extractor-tests/generated/decl/NamedFunction/NamedFunction.ql bf58ac96d6fbc3294c5780000539486d52b7ed9ff797647b83c5914ee9c12cf2 5294555db2567fd78e7580ff899819ed4bb3000c8046a806828ae67098b3e743
test/extractor-tests/generated/decl/NamedFunction/NamedFunction.ql b4cd0ecfb1768898b8115874e168bbe780c06ddd09f8337f99096dd2c80af090 838b2d5e94f632b8f2f0b89eb5c06fed515ff82c78f5dd2063610485f4d949dc
test/extractor-tests/generated/decl/NamedFunction/NamedFunction_getBody.ql 365c3f2bcf802880455e0523bc6d992740d08119cc307751f6accb031f60a8b9 0f0b9ff9c0dbebb0b7b177e01d9082647f5544fa4cb9fd4c2ac228538f37cd87
test/extractor-tests/generated/decl/NamedFunction/NamedFunction_getCapture.ql 25d10d0d28cdf5eb73dc2be56eaefed13ccd9bf5808480a950f9d91a26db93e9 fcb2af9a0032c60d08a2025688886905c5f3792a6d017f0552bdfbb8c736c118
test/extractor-tests/generated/decl/NamedFunction/NamedFunction_getGenericTypeParam.ql 60873ee0c149f7a66572c79a7e86e2c15e7b13bae618988e6a70b7f62ea01b65 be346e023edd258cd050645b6bcb2b1dfbab8a3012b473abd33ea1386471a4ea

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,36 @@
| accessors.swift:2:9:2:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:2:9:2:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:2:9:2:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:3:9:3:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:4:9:4:28 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:5:9:5:42 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:8:9:8:29 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:12:9:12:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:16:9:16:28 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:20:9:20:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:24:9:24:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:26:9:26:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:29:9:29:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:29:9:29:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:30:9:32:9 | _read | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | yes | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:33:9:35:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:39:9:41:9 | unsafeAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> UnsafePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | yes | isUnsafeMutableAddress: | no |
| accessors.swift:42:9:44:9 | unsafeMutableAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> UnsafeMutablePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | yes |
| accessors.swift:2:9:2:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:2:9:2:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:2:9:2:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:3:9:3:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:4:9:4:28 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:5:9:5:42 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:7:9:7:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:8:9:8:29 | willSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:11:9:11:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:12:9:12:19 | willSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:15:9:15:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:16:9:16:28 | didSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:19:9:19:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:20:9:20:18 | didSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:23:9:23:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:24:9:24:19 | willSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:26:9:26:18 | didSet | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:29:9:29:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:29:9:29:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:30:9:32:9 | _read | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | yes | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:33:9:35:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | _modify | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | get | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:38:9:38:9 | set | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
| accessors.swift:39:9:41:9 | unsafeAddress | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> UnsafePointer<Int> | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | yes | isUnsafeMutableAddress: | no |
| accessors.swift:42:9:44:9 | unsafeMutableAddress | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> UnsafeMutablePointer<Int> | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | yes |

View File

@@ -3,23 +3,22 @@ import codeql.swift.elements
import TestUtils
from
Accessor x, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
int getNumberOfCaptures, int getNumberOfGenericTypeParams, ModuleDecl getModule,
int getNumberOfMembers, Type getInterfaceType, string isGetter, string isSetter, string isWillSet,
string isDidSet, string isRead, string isModify, string isUnsafeAddress,
string isUnsafeMutableAddress
Accessor x, int getNumberOfGenericTypeParams, ModuleDecl getModule, int getNumberOfMembers,
Type getInterfaceType, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
int getNumberOfCaptures, string isGetter, string isSetter, string isWillSet, string isDidSet,
string isRead, string isModify, string isUnsafeAddress, string isUnsafeMutableAddress
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getModule = x.getModule() and
getNumberOfMembers = x.getNumberOfMembers() and
getInterfaceType = x.getInterfaceType() and
(if x.hasName() then hasName = "yes" else hasName = "no") and
(if x.hasSelfParam() then hasSelfParam = "yes" else hasSelfParam = "no") and
getNumberOfParams = x.getNumberOfParams() and
(if x.hasBody() then hasBody = "yes" else hasBody = "no") and
getNumberOfCaptures = x.getNumberOfCaptures() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getModule = x.getModule() and
getNumberOfMembers = x.getNumberOfMembers() and
getInterfaceType = x.getInterfaceType() and
(if x.isGetter() then isGetter = "yes" else isGetter = "no") and
(if x.isSetter() then isSetter = "yes" else isSetter = "no") and
(if x.isWillSet() then isWillSet = "yes" else isWillSet = "no") and
@@ -30,10 +29,9 @@ where
if x.isUnsafeMutableAddress()
then isUnsafeMutableAddress = "yes"
else isUnsafeMutableAddress = "no"
select x, "hasName:", hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:",
getNumberOfParams, "hasBody:", hasBody, "getNumberOfCaptures:", getNumberOfCaptures,
"getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType, "isGetter:",
isGetter, "isSetter:", isSetter, "isWillSet:", isWillSet, "isDidSet:", isDidSet, "isRead:",
isRead, "isModify:", isModify, "isUnsafeAddress:", isUnsafeAddress, "isUnsafeMutableAddress:",
isUnsafeMutableAddress
select x, "getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType, "hasName:",
hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:", getNumberOfParams, "hasBody:",
hasBody, "getNumberOfCaptures:", getNumberOfCaptures, "isGetter:", isGetter, "isSetter:",
isSetter, "isWillSet:", isWillSet, "isDidSet:", isDidSet, "isRead:", isRead, "isModify:",
isModify, "isUnsafeAddress:", isUnsafeAddress, "isUnsafeMutableAddress:", isUnsafeMutableAddress

View File

@@ -1,4 +1,4 @@
| extensions.swift:5:1:9:1 | extension of S | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 3 | getNumberOfGenericTypeParams: | 0 | getExtendedTypeDecl: | extensions.swift:1:1:1:11 | S | getNumberOfProtocols: | 0 |
| extensions.swift:11:1:15:1 | extension of C | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 3 | getNumberOfGenericTypeParams: | 0 | getExtendedTypeDecl: | extensions.swift:3:1:3:10 | C | getNumberOfProtocols: | 0 |
| extensions.swift:21:1:23:1 | extension of S | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 1 | getNumberOfGenericTypeParams: | 0 | getExtendedTypeDecl: | extensions.swift:1:1:1:11 | S | getNumberOfProtocols: | 1 |
| extensions.swift:27:1:29:1 | extension of C | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 1 | getNumberOfGenericTypeParams: | 0 | getExtendedTypeDecl: | extensions.swift:3:1:3:10 | C | getNumberOfProtocols: | 2 |
| extensions.swift:5:1:9:1 | extension of S | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 3 | getExtendedTypeDecl: | extensions.swift:1:1:1:11 | S | getNumberOfProtocols: | 0 |
| extensions.swift:11:1:15:1 | extension of C | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 3 | getExtendedTypeDecl: | extensions.swift:3:1:3:10 | C | getNumberOfProtocols: | 0 |
| extensions.swift:21:1:23:1 | extension of S | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 1 | getExtendedTypeDecl: | extensions.swift:1:1:1:11 | S | getNumberOfProtocols: | 1 |
| extensions.swift:27:1:29:1 | extension of C | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | extensions | getNumberOfMembers: | 1 | getExtendedTypeDecl: | extensions.swift:3:1:3:10 | C | getNumberOfProtocols: | 2 |

View File

@@ -3,16 +3,16 @@ import codeql.swift.elements
import TestUtils
from
ExtensionDecl x, ModuleDecl getModule, int getNumberOfMembers, int getNumberOfGenericTypeParams,
ExtensionDecl x, int getNumberOfGenericTypeParams, ModuleDecl getModule, int getNumberOfMembers,
NominalTypeDecl getExtendedTypeDecl, int getNumberOfProtocols
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getModule = x.getModule() and
getNumberOfMembers = x.getNumberOfMembers() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getExtendedTypeDecl = x.getExtendedTypeDecl() and
getNumberOfProtocols = x.getNumberOfProtocols()
select x, "getModule:", getModule, "getNumberOfMembers:", getNumberOfMembers,
"getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getExtendedTypeDecl:",
getExtendedTypeDecl, "getNumberOfProtocols:", getNumberOfProtocols
select x, "getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
"getNumberOfMembers:", getNumberOfMembers, "getExtendedTypeDecl:", getExtendedTypeDecl,
"getNumberOfProtocols:", getNumberOfProtocols

View File

@@ -1,5 +1,5 @@
| functions.swift:1:1:3:1 | foo() | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | () -> Int |
| functions.swift:5:1:7:1 | bar(_:d:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int, Double) -> Int |
| functions.swift:10:5:10:28 | noBody(x:) | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | no | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int |
| functions.swift:13:1:15:1 | variadic(_:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int...) -> () |
| functions.swift:17:1:19:1 | generic(x:y:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 2 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <X, Y> (X, Y) -> () |
| functions.swift:1:1:3:1 | foo() | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | () -> Int | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 |
| functions.swift:5:1:7:1 | bar(_:d:) | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int, Double) -> Int | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 |
| functions.swift:10:5:10:28 | noBody(x:) | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | no | getNumberOfCaptures: | 0 |
| functions.swift:13:1:15:1 | variadic(_:) | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int...) -> () | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 |
| functions.swift:17:1:19:1 | generic(x:y:) | getNumberOfGenericTypeParams: | 2 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <X, Y> (X, Y) -> () | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 |

View File

@@ -3,22 +3,22 @@ import codeql.swift.elements
import TestUtils
from
NamedFunction x, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
int getNumberOfCaptures, int getNumberOfGenericTypeParams, ModuleDecl getModule,
int getNumberOfMembers, Type getInterfaceType
NamedFunction x, int getNumberOfGenericTypeParams, ModuleDecl getModule, int getNumberOfMembers,
Type getInterfaceType, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
int getNumberOfCaptures
where
toBeTested(x) and
not x.isUnknown() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getModule = x.getModule() and
getNumberOfMembers = x.getNumberOfMembers() and
getInterfaceType = x.getInterfaceType() and
(if x.hasName() then hasName = "yes" else hasName = "no") and
(if x.hasSelfParam() then hasSelfParam = "yes" else hasSelfParam = "no") and
getNumberOfParams = x.getNumberOfParams() and
(if x.hasBody() then hasBody = "yes" else hasBody = "no") and
getNumberOfCaptures = x.getNumberOfCaptures() and
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
getModule = x.getModule() and
getNumberOfMembers = x.getNumberOfMembers() and
getInterfaceType = x.getInterfaceType()
select x, "hasName:", hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:",
getNumberOfParams, "hasBody:", hasBody, "getNumberOfCaptures:", getNumberOfCaptures,
"getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType
getNumberOfCaptures = x.getNumberOfCaptures()
select x, "getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType, "hasName:",
hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:", getNumberOfParams, "hasBody:",
hasBody, "getNumberOfCaptures:", getNumberOfCaptures