mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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 ```
20 lines
1.0 KiB
Plaintext
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
|