Files
codeql/swift/ql/test/library-tests/elements/KeyPathComponent/KindAccessors.ql
Jeroen Ketema 119b058629 Swift: Handle method and initializer key path components in QL
Note that it does not seem to be possible to write test that exercise this
code. Passing `-enable-experimental-feature KeyPathWithMethodMembers` to the
extractor results in:
```
error: experimental feature 'KeyPathWithMethodMembers' cannot be enabled in production compiler
```
2025-10-31 09:58:09 +01:00

20 lines
1.0 KiB
Plaintext

import codeql.swift.elements
import TestUtils
from
KeyPathComponent x, string apply, string property, string subscript, string opt_forcing,
string opt_chaining, string opt_wrapping, string self, string tuple_indexing
where
toBeTested(x) and
not x.isUnknown() and
(if x.isApply() then apply = "apply" else apply = "") and
(if x.isProperty() then property = "property" else property = "") and
(if x.isSubscript() then subscript = "subscript" else subscript = "") and
(if x.isOptionalForcing() then opt_forcing = "optional forcing" else opt_forcing = "") and
(if x.isOptionalChaining() then opt_chaining = "optional chaining" else opt_chaining = "") and
(if x.isOptionalWrapping() then opt_wrapping = "optional wrapping" else opt_wrapping = "") and
(if x.isSelf() then self = "self" else self = "") and
if x.isTupleIndexing() then tuple_indexing = "tuple indexing" else tuple_indexing = ""
select x, "getKind:", x.getKind(), apply, property, subscript, opt_forcing, opt_chaining,
opt_wrapping, self, tuple_indexing