|
2 | 2 | private import codeql.swift.generated.Synth |
3 | 3 | private import codeql.swift.generated.Raw |
4 | 4 | import codeql.swift.elements.expr.Expr |
| 5 | +import codeql.swift.elements.decl.ParamDecl |
5 | 6 |
|
6 | 7 | module Generated { |
| 8 | + /** |
| 9 | + * An implicit application of a property wrapper. |
| 10 | + */ |
7 | 11 | class AppliedPropertyWrapperExpr extends Synth::TAppliedPropertyWrapperExpr, Expr { |
8 | 12 | override string getAPrimaryQlClass() { result = "AppliedPropertyWrapperExpr" } |
| 13 | + |
| 14 | + /** |
| 15 | + * Gets the kind of this applied property wrapper expression. |
| 16 | + * |
| 17 | + * This is 1 for the wrapped value and 2 for the projected one. |
| 18 | + */ |
| 19 | + int getKind() { |
| 20 | + result = |
| 21 | + Synth::convertAppliedPropertyWrapperExprToRaw(this) |
| 22 | + .(Raw::AppliedPropertyWrapperExpr) |
| 23 | + .getKind() |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * Gets the value of this applied property wrapper expression. |
| 28 | + * |
| 29 | + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the |
| 30 | + * behavior of both the `Immediate` and non-`Immediate` versions. |
| 31 | + */ |
| 32 | + Expr getImmediateValue() { |
| 33 | + result = |
| 34 | + Synth::convertExprFromRaw(Synth::convertAppliedPropertyWrapperExprToRaw(this) |
| 35 | + .(Raw::AppliedPropertyWrapperExpr) |
| 36 | + .getValue()) |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Gets the value of this applied property wrapper expression. |
| 41 | + * |
| 42 | + * The value on which the wrapper is applied. |
| 43 | + */ |
| 44 | + final Expr getValue() { result = getImmediateValue().resolve() } |
| 45 | + |
| 46 | + /** |
| 47 | + * Gets the parameter declaration owning this wrapper application. |
| 48 | + * |
| 49 | + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the |
| 50 | + * behavior of both the `Immediate` and non-`Immediate` versions. |
| 51 | + */ |
| 52 | + ParamDecl getImmediateParam() { |
| 53 | + result = |
| 54 | + Synth::convertParamDeclFromRaw(Synth::convertAppliedPropertyWrapperExprToRaw(this) |
| 55 | + .(Raw::AppliedPropertyWrapperExpr) |
| 56 | + .getParam()) |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * Gets the parameter declaration owning this wrapper application. |
| 61 | + */ |
| 62 | + final ParamDecl getParam() { result = getImmediateParam().resolve() } |
9 | 63 | } |
10 | 64 | } |
0 commit comments