Skip to content

Commit 80ae9c2

Browse files
committed
Swift: Update KeyPathComponent for new kind values
1 parent 2c9b729 commit 80ae9c2

File tree

3 files changed

+29
-26
lines changed

3 files changed

+29
-26
lines changed

swift/ql/lib/codeql/swift/elements/internal/KeyPathComponentImpl.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ module Impl {
1010
/**
1111
* Property access like `.bar` in `\Foo.bar`.
1212
*/
13-
predicate isProperty() { this.getKind() = 3 }
13+
predicate isProperty() { this.getKind() = 5 }
1414

1515
/**
1616
* Array or dictionary subscript like `[1]` or `["a", "b"]`.
1717
*/
18-
predicate isSubscript() { this.getKind() = 4 }
18+
predicate isSubscript() { this.getKind() = 6 }
1919

2020
/**
2121
* Optional forcing `!`.
2222
*/
23-
predicate isOptionalForcing() { this.getKind() = 5 }
23+
predicate isOptionalForcing() { this.getKind() = 7 }
2424

2525
/**
2626
* Optional chaining `?`.
2727
*/
28-
predicate isOptionalChaining() { this.getKind() = 6 }
28+
predicate isOptionalChaining() { this.getKind() = 8 }
2929

3030
/**
3131
* Implicit optional wrapping component inserted by the compiler when an optional chain ends in a non-optional value.
3232
*/
33-
predicate isOptionalWrapping() { this.getKind() = 7 }
33+
predicate isOptionalWrapping() { this.getKind() = 9 }
3434

3535
/**
3636
* Reference to the entire object; the `self` in `\Foo.self`.
3737
*/
38-
predicate isSelf() { this.getKind() = 8 }
38+
predicate isSelf() { this.getKind() = 10 }
3939

4040
/**
4141
* Tuple indexing like `.1`.
4242
*/
43-
predicate isTupleIndexing() { this.getKind() = 9 }
43+
predicate isTupleIndexing() { this.getKind() = 11 }
4444

4545
/** Gets the underlying key-path expression which this is a component of. */
4646
KeyPathExpr getKeyPathExpr() { result.getAComponent() = this }

swift/ql/lib/codeql/swift/generated/KeyPathComponent.qll

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
| file://:0:0:0:0 | KeyPathComponent | getKind: | 7 | | | | | optional wrapping | | |
2-
| key_path_expr.swift:11:17:11:17 | KeyPathComponent | getKind: | 3 | property | | | | | | |
3-
| key_path_expr.swift:12:24:12:26 | KeyPathComponent | getKind: | 4 | | subscript | | | | | |
4-
| key_path_expr.swift:13:34:13:38 | KeyPathComponent | getKind: | 4 | | subscript | | | | | |
5-
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 5 | | | optional forcing | | | | |
6-
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 8 | | | | | | self | |
7-
| key_path_expr.swift:15:21:15:21 | KeyPathComponent | getKind: | 3 | property | | | | | | |
8-
| key_path_expr.swift:15:24:15:24 | KeyPathComponent | getKind: | 6 | | | | optional chaining | | | |
9-
| key_path_expr.swift:15:26:15:26 | KeyPathComponent | getKind: | 3 | property | | | | | | |
10-
| key_path_expr.swift:16:25:16:25 | KeyPathComponent | getKind: | 3 | property | | | | | | |
11-
| key_path_expr.swift:16:28:16:28 | KeyPathComponent | getKind: | 6 | | | | optional chaining | | | |
12-
| key_path_expr.swift:16:30:16:30 | KeyPathComponent | getKind: | 3 | property | | | | | | |
13-
| key_path_expr.swift:17:16:17:16 | KeyPathComponent | getKind: | 8 | | | | | | self | |
14-
| key_path_expr.swift:18:32:18:32 | KeyPathComponent | getKind: | 9 | | | | | | | tuple indexing |
1+
| file://:0:0:0:0 | KeyPathComponent | getKind: | 9 | | | | | optional wrapping | | |
2+
| key_path_expr.swift:11:17:11:17 | KeyPathComponent | getKind: | 5 | property | | | | | | |
3+
| key_path_expr.swift:12:24:12:26 | KeyPathComponent | getKind: | 6 | | subscript | | | | | |
4+
| key_path_expr.swift:13:34:13:38 | KeyPathComponent | getKind: | 6 | | subscript | | | | | |
5+
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 7 | | | optional forcing | | | | |
6+
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 10 | | | | | | self | |
7+
| key_path_expr.swift:15:21:15:21 | KeyPathComponent | getKind: | 5 | property | | | | | | |
8+
| key_path_expr.swift:15:24:15:24 | KeyPathComponent | getKind: | 8 | | | | optional chaining | | | |
9+
| key_path_expr.swift:15:26:15:26 | KeyPathComponent | getKind: | 5 | property | | | | | | |
10+
| key_path_expr.swift:16:25:16:25 | KeyPathComponent | getKind: | 5 | property | | | | | | |
11+
| key_path_expr.swift:16:28:16:28 | KeyPathComponent | getKind: | 8 | | | | optional chaining | | | |
12+
| key_path_expr.swift:16:30:16:30 | KeyPathComponent | getKind: | 5 | property | | | | | | |
13+
| key_path_expr.swift:17:16:17:16 | KeyPathComponent | getKind: | 10 | | | | | | self | |
14+
| key_path_expr.swift:18:32:18:32 | KeyPathComponent | getKind: | 11 | | | | | | | tuple indexing |

0 commit comments

Comments
 (0)