CodeQL library for Swift
codeql/swift-all 3.0.1-dev (changelog, source)
Search

Member predicate Raw::VarDecl::getPropertyWrapperProjectionVar

Gets the property wrapper projection variable of this variable declaration, if it exists.

If this variable has a property wrapper with a projected value, this is the corresponding synthesized variable holding that projected value, accessible with this variable’s name prefixed with $.

For a property wrapper like

@propertyWrapper struct MyWrapper {
  var projectedValue : Bool
  ...
}

struct S {
  @MyWrapper var x : Int = 42
}
the compiler synthesizes a variable in `S` along the lines of

var $x : Bool { … }

This predicate returns such variable declaration.
VarDecl getPropertyWrapperProjectionVar()