Swift: remove debug test and fix generation

This commit is contained in:
Paolo Tranquilli
2022-11-10 13:42:37 +01:00
parent edfecddca1
commit de8e7b0f27
3 changed files with 2 additions and 115 deletions

View File

@@ -6,7 +6,7 @@ import codeql.swift.elements.decl.ParamDecl
module Generated {
/**
* An implicit application of a property wrapper.
* An implicit application of a property wrapper on the argument of a call.
*/
class AppliedPropertyWrapperExpr extends Synth::TAppliedPropertyWrapperExpr, Expr {
override string getAPrimaryQlClass() { result = "AppliedPropertyWrapperExpr" }
@@ -14,7 +14,7 @@ module Generated {
/**
* Gets the kind of this applied property wrapper expression.
*
* This is 1 for the wrapped value and 2 for the projected one.
* This is 1 for a wrapped value and 2 for a projected one.
*/
int getKind() {
result =

View File

@@ -1,112 +0,0 @@
#-----| [ModuleDecl] __ObjC
#-----| [ModuleDecl] applied_property_wrapper
#-----| [AppliedPropertyWrapperExpr] AppliedPropertyWrapperExpr
applied_property_wrapper.swift:
# 1| [StructDecl] Wrapper
# 2| getMember(0): [PatternBindingDecl] var ... = ...
# 2| getPattern(0): [TypedPattern] ... as ...
# 2| getSubPattern(): [NamedPattern] wrappedValue
# 2| getTypeRepr(): [TypeRepr] Int
# 2| getMember(1): [ConcreteVarDecl] wrappedValue
# 2| Type = Int
# 3| getAccessorDecl(0): [AccessorDecl] get
# 3| InterfaceType = (Wrapper) -> () -> Int
# 3| getSelfParam(): [ParamDecl] self
# 3| Type = Wrapper
# 3| getBody(): [BraceStmt] { ... }
# 3| getElement(0): [ReturnStmt] return ...
# 3| getResult(): [IntegerLiteralExpr] 404
# 4| getAccessorDecl(1): [AccessorDecl] set
# 4| InterfaceType = (inout Wrapper) -> (Int) -> ()
# 4| getSelfParam(): [ParamDecl] self
# 4| Type = Wrapper
# 4| getParam(0): [ParamDecl] newValue
# 4| Type = Int
# 4| getBody(): [BraceStmt] { ... }
# 2| getAccessorDecl(2): [AccessorDecl] (unnamed function decl)
# 2| InterfaceType = (inout Wrapper) -> () -> ()
# 2| getSelfParam(): [ParamDecl] self
# 2| Type = Wrapper
# 2| getBody(): [BraceStmt] { ... }
# 2| getElement(0): [YieldStmt] yield ...
# 6| getMember(2): [PatternBindingDecl] var ... = ...
# 6| getInit(0): [BooleanLiteralExpr] false
# 6| getPattern(0): [TypedPattern] ... as ...
# 6| getSubPattern(): [NamedPattern] projectedValue
# 6| getTypeRepr(): [TypeRepr] Bool
# 6| getMember(3): [ConcreteVarDecl] projectedValue
# 6| Type = Bool
# 6| getAccessorDecl(0): [AccessorDecl] get
# 6| InterfaceType = (Wrapper) -> () -> Bool
# 6| getSelfParam(): [ParamDecl] self
# 6| Type = Wrapper
# 6| getBody(): [BraceStmt] { ... }
# 6| getAccessorDecl(1): [AccessorDecl] set
# 6| InterfaceType = (inout Wrapper) -> (Bool) -> ()
# 6| getSelfParam(): [ParamDecl] self
# 6| Type = Wrapper
# 6| getParam(0): [ParamDecl] value
# 6| Type = Bool
# 6| getBody(): [BraceStmt] { ... }
# 6| getAccessorDecl(2): [AccessorDecl] (unnamed function decl)
# 6| InterfaceType = (inout Wrapper) -> () -> ()
# 6| getSelfParam(): [ParamDecl] self
# 6| Type = Wrapper
# 6| getBody(): [BraceStmt] { ... }
# 6| getElement(0): [YieldStmt] yield ...
# 8| getMember(4): [ConstructorDecl] init(wrappedValue:)
# 8| InterfaceType = (Wrapper.Type) -> (Int) -> Wrapper
# 8| getSelfParam(): [ParamDecl] self
# 8| Type = Wrapper
# 8| getParam(0): [ParamDecl] wrappedValue
# 8| Type = Int
# 8| getBody(): [BraceStmt] { ... }
# 8| getElement(0): [ReturnStmt] return
# 9| getMember(5): [ConstructorDecl] init(projectedValue:)
# 9| InterfaceType = (Wrapper.Type) -> (Bool) -> Wrapper
# 9| getSelfParam(): [ParamDecl] self
# 9| Type = Wrapper
# 9| getParam(0): [ParamDecl] projectedValue
# 9| Type = Bool
# 9| getBody(): [BraceStmt] { ... }
# 9| getElement(0): [ReturnStmt] return
# 12| [ConcreteFuncDecl] foo(x:)
# 12| InterfaceType = (Wrapper) -> ()
# 12| getParam(0): [ParamDecl] x
# 12| Type = Int
# 12| getBody(): [BraceStmt] { ... }
# 14| [TopLevelCodeDecl] { ... }
# 14| getBody(): [BraceStmt] { ... }
# 14| getElement(0): [CallExpr] call to foo(x:)
# 14| getFunction(): [DeclRefExpr] foo(x:)
# 14| getArgument(0): [Argument] x: AppliedPropertyWrapperExpr
# 14| getExpr(): [AppliedPropertyWrapperExpr] AppliedPropertyWrapperExpr
# 14| getValue(): [IntegerLiteralExpr] 42
# 15| [TopLevelCodeDecl] { ... }
# 15| getBody(): [BraceStmt] { ... }
# 15| getElement(0): [CallExpr] call to foo(x:)
# 15| getFunction(): [DeclRefExpr] foo(x:)
# 15| getArgument(0): [Argument] x: AppliedPropertyWrapperExpr
# 15| getExpr(): [AppliedPropertyWrapperExpr] AppliedPropertyWrapperExpr
# 15| getValue(): [BooleanLiteralExpr] true
# 17| [TopLevelCodeDecl] { ... }
# 17| getBody(): [BraceStmt] { ... }
# 17| getElement(0): [PatternBindingDecl] var ... = ...
# 17| getInit(0): [AutoClosureExpr] { ... }
# 17| getBody(): [BraceStmt] { ... }
# 17| getElement(0): [ReturnStmt] return ...
# 17| getResult(): [CallExpr] call to ...
# 17| getFunction(): [ClosureExpr] { ... }
# 17| getParam(0): [ParamDecl] y
# 17| Type = Int
# 17| getBody(): [BraceStmt] { ... }
# 17| getElement(0): [ReturnStmt] return ...
# 17| getPattern(0): [NamedPattern] closure
# 17| [ConcreteVarDecl] closure
# 17| Type = (Int) -> ()
# 19| [TopLevelCodeDecl] { ... }
# 19| getBody(): [BraceStmt] { ... }
# 19| getElement(0): [CallExpr] call to ...
# 19| getFunction(): [DeclRefExpr] closure
# 19| getArgument(0): [Argument] : 42
# 19| getExpr(): [IntegerLiteralExpr] 42

View File

@@ -1 +0,0 @@
library-tests/ast/PrintAst.ql