Skip to content

Commit 47b26dd

Browse files
authored
Merge pull request #20446 from github/jketema/swift-6.2
Swift: Make extractor compile with Swift 6.2
2 parents d478752 + be0d405 commit 47b26dd

File tree

89 files changed

+12057
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+12057
-643
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class AvailabilitySpec extends @availability_spec {
2+
string toString() { none() }
3+
}
4+
5+
query predicate new_other_availability_specs(AvailabilitySpec id) {
6+
availability_specs(id) and
7+
availability_spec_is_wildcard(id)
8+
}
9+
10+
query predicate new_platform_version_availability_specs(
11+
AvailabilitySpec id, string platform, string version
12+
) {
13+
availability_specs(id) and
14+
availability_spec_platforms(id, platform) and
15+
availability_spec_versions(id, version)
16+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
class KeyPathComponent extends @key_path_component {
2+
string toString() { none() }
3+
}
4+
5+
class Element extends @element {
6+
string toString() { none() }
7+
}
8+
9+
class ArgumentOrNone extends @argument_or_none {
10+
string toString() { none() }
11+
}
12+
13+
class TypeOrNone extends @type_or_none {
14+
string toString() { none() }
15+
}
16+
17+
class ValueDeclOrNone extends @value_decl_or_none {
18+
string toString() { none() }
19+
}
20+
21+
predicate isKeyPathComponentWithNewKind(KeyPathComponent id) {
22+
key_path_components(id, 3, _) or key_path_components(id, 4, _)
23+
}
24+
25+
query predicate new_key_path_components(KeyPathComponent id, int kind, TypeOrNone component_type) {
26+
exists(int old_kind |
27+
key_path_components(id, old_kind, component_type) and
28+
not isKeyPathComponentWithNewKind(id) and
29+
if old_kind < 5 then kind = old_kind else kind = old_kind - 2
30+
)
31+
}
32+
33+
query predicate new_key_path_component_subscript_arguments(
34+
KeyPathComponent id, int index, ArgumentOrNone subscript_argument
35+
) {
36+
key_path_component_subscript_arguments(id, index, subscript_argument) and
37+
not isKeyPathComponentWithNewKind(id)
38+
}
39+
40+
query predicate new_key_path_component_tuple_indices(KeyPathComponent id, int tuple_index) {
41+
key_path_component_tuple_indices(id, tuple_index) and
42+
not isKeyPathComponentWithNewKind(id)
43+
}
44+
45+
query predicate new_key_path_component_decl_refs(KeyPathComponent id, ValueDeclOrNone decl_ref) {
46+
key_path_component_decl_refs(id, decl_ref) and
47+
not isKeyPathComponentWithNewKind(id)
48+
}
49+
50+
query predicate new_unspecified_elements(Element id, string property, string error) {
51+
unspecified_elements(id, property, error)
52+
or
53+
isKeyPathComponentWithNewKind(id) and
54+
property = "" and
55+
error =
56+
"UnresolvedApply and Apply KeyPathComponents removed during database downgrade. Please update your CodeQL."
57+
}

0 commit comments

Comments
 (0)