Skip to content

Swift: make extractor compile again after 6.1 upgrade #19315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Swift: Update test results for ParenType no longer being extracted
  • Loading branch information
jketema authored and Paolo Tranquilli committed Apr 23, 2025
commit b6076c04811634994f60cfdd96555be374808b0c
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ closures.swift:
# 24| getSubExpr(): [CallExpr] call to ...
# 24| getFunction(): [BindOptionalExpr] ...?
# 24| getSubExpr(): [DeclRefExpr] escape
# 24| getFunction().getFullyConverted(): [LoadExpr] ((() -> ())) ...
# 24| getFunction().getFullyConverted(): [LoadExpr] (() -> ()) ...
# 24| getSubExpr().getFullyConverted(): [InjectIntoOptionalExpr] (()?) ...
# 24| getCapture(0): [CapturedDecl] escape
# 27| [NamedFunction] logical()
@@ -145,8 +145,8 @@ closures.swift:
# 30| getArgument(0): [Argument] : ... .!=(_:_:) ...
# 30| getExpr(): [BinaryExpr] ... .!=(_:_:) ...
# 30| getFunction(): [MethodLookupExpr] .!=(_:_:)
# 30| getBase(): [TypeExpr] Optional<((Int) -> Int)>.Type
# 30| getTypeRepr(): [TypeRepr] Optional<((Int) -> Int)>
# 30| getBase(): [TypeExpr] Optional<(Int) -> Int>.Type
# 30| getTypeRepr(): [TypeRepr] Optional<(Int) -> Int>
# 30| getMethodRef(): [DeclRefExpr] !=(_:_:)
# 30| getArgument(0): [Argument] : f
# 30| getExpr(): [DeclRefExpr] f
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
| identity_expressions.swift:5:9:5:14 | .self | A |
| identity_expressions.swift:5:9:5:21 | .self | @lvalue Int |
| identity_expressions.swift:5:28:5:31 | (...) | (Int) |
| identity_expressions.swift:9:5:9:9 | (...) | (A) |
| identity_expressions.swift:12:28:12:43 | (...) | (A) |
| identity_expressions.swift:5:28:5:31 | (...) | Int |
| identity_expressions.swift:9:5:9:9 | (...) | A |
| identity_expressions.swift:12:28:12:43 | (...) | A |
| identity_expressions.swift:12:29:12:42 | await ... | A |
| identity_expressions.swift:15:5:15:21 | await ... | () |
| identity_expressions.swift:15:11:15:19 | (...) | (() async -> ()) |
| identity_expressions.swift:15:11:15:19 | (...) | () async -> () |
| identity_expressions.swift:18:9:18:17 | BorrowExpr | Int |
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
| P1 & (P2 & P3) | getName: | P1 & (P2 & P3) | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 |
| P1 & P2 & P3 | getName: | P1 & P2 & P3 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 3 |
| P1 & P23 | getName: | P1 & P23 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 |
| P2 & P4 | getName: | P2 & P4 | getCanonicalType: | P2 & P4 | getNumberOfMembers: | 2 |
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
| P1 & (P2 & P3) | 0 | P1 |
| P1 & (P2 & P3) | 1 | (P2 & P3) |
| P1 & P2 & P3 | 0 | P1 |
| P1 & P2 & P3 | 1 | P2 |
| P1 & P2 & P3 | 2 | P3 |
48 changes: 24 additions & 24 deletions swift/ql/test/extractor-tests/patterns/types.expected
Original file line number Diff line number Diff line change
@@ -63,9 +63,9 @@
| patterns.swift:78:9:78:13 | ... as ... | MyEnum |
| patterns.swift:81:10:81:11 | .myNone | MyEnum |
| patterns.swift:83:10:83:25 | .mySingle(...) | MyEnum |
| patterns.swift:83:19:83:25 | (...) | (Int) |
| patterns.swift:83:20:83:24 | let ... | (Int) |
| patterns.swift:83:24:83:24 | a | (Int) |
| patterns.swift:83:19:83:25 | (...) | Int |
| patterns.swift:83:20:83:24 | let ... | Int |
| patterns.swift:83:24:83:24 | a | Int |
| patterns.swift:85:10:85:30 | .myPair(...) | MyEnum |
| patterns.swift:85:17:85:30 | (...) | (Int, Int) |
| patterns.swift:85:18:85:22 | let ... | Int |
@@ -78,9 +78,9 @@
| patterns.swift:88:22:88:22 | a | Int |
| patterns.swift:88:25:88:25 | _ | MyEnum |
| patterns.swift:92:13:92:28 | .mySingle(...) | MyEnum |
| patterns.swift:92:22:92:28 | (...) | (Int) |
| patterns.swift:92:23:92:27 | let ... | (Int) |
| patterns.swift:92:27:92:27 | x | (Int) |
| patterns.swift:92:22:92:28 | (...) | Int |
| patterns.swift:92:23:92:27 | let ... | Int |
| patterns.swift:92:27:92:27 | x | Int |
| patterns.swift:95:13:95:33 | .myPair(...) | MyEnum |
| patterns.swift:95:20:95:33 | (...) | (Int, Int) |
| patterns.swift:95:21:95:25 | let ... | Int |
@@ -89,9 +89,9 @@
| patterns.swift:95:32:95:32 | y | Int |
| patterns.swift:103:10:103:11 | .myNone | MyEnum |
| patterns.swift:105:10:105:25 | .mySingle(...) | MyEnum |
| patterns.swift:105:19:105:25 | (...) | (Int) |
| patterns.swift:105:20:105:24 | let ... | (Int) |
| patterns.swift:105:24:105:24 | a | (Int) |
| patterns.swift:105:19:105:25 | (...) | Int |
| patterns.swift:105:20:105:24 | let ... | Int |
| patterns.swift:105:24:105:24 | a | Int |
| patterns.swift:107:10:107:30 | .myPair(...) | MyEnum |
| patterns.swift:107:17:107:30 | (...) | (Int, Int) |
| patterns.swift:107:18:107:22 | let ... | Int |
@@ -104,9 +104,9 @@
| patterns.swift:110:22:110:22 | a | Int |
| patterns.swift:110:25:110:25 | _ | MyEnum |
| patterns.swift:114:13:114:28 | .mySingle(...) | MyEnum |
| patterns.swift:114:22:114:28 | (...) | (Int) |
| patterns.swift:114:23:114:27 | let ... | (Int) |
| patterns.swift:114:27:114:27 | x | (Int) |
| patterns.swift:114:22:114:28 | (...) | Int |
| patterns.swift:114:23:114:27 | let ... | Int |
| patterns.swift:114:27:114:27 | x | Int |
| patterns.swift:117:13:117:33 | .myPair(...) | MyEnum |
| patterns.swift:117:20:117:33 | (...) | (Int, Int) |
| patterns.swift:117:21:117:25 | let ... | Int |
@@ -115,9 +115,9 @@
| patterns.swift:117:32:117:32 | y | Int |
| patterns.swift:125:10:125:11 | .myNone | MyEnum |
| patterns.swift:127:10:127:25 | .mySingle(...) | MyEnum |
| patterns.swift:127:19:127:25 | (...) | (Int) |
| patterns.swift:127:20:127:24 | let ... | (Int) |
| patterns.swift:127:24:127:24 | a | (Int) |
| patterns.swift:127:19:127:25 | (...) | Int |
| patterns.swift:127:20:127:24 | let ... | Int |
| patterns.swift:127:24:127:24 | a | Int |
| patterns.swift:129:10:129:30 | .myPair(...) | MyEnum |
| patterns.swift:129:17:129:30 | (...) | (Int, Int) |
| patterns.swift:129:18:129:22 | let ... | Int |
@@ -130,9 +130,9 @@
| patterns.swift:132:22:132:22 | a | Int |
| patterns.swift:132:25:132:25 | _ | MyEnum |
| patterns.swift:136:13:136:28 | .mySingle(...) | MyEnum |
| patterns.swift:136:22:136:28 | (...) | (Int) |
| patterns.swift:136:23:136:27 | let ... | (Int) |
| patterns.swift:136:27:136:27 | x | (Int) |
| patterns.swift:136:22:136:28 | (...) | Int |
| patterns.swift:136:23:136:27 | let ... | Int |
| patterns.swift:136:27:136:27 | x | Int |
| patterns.swift:139:13:139:33 | .myPair(...) | MyEnum |
| patterns.swift:139:20:139:33 | (...) | (Int, Int) |
| patterns.swift:139:21:139:25 | let ... | Int |
@@ -143,9 +143,9 @@
| patterns.swift:144:9:144:12 | ... as ... | MyEnum |
| patterns.swift:147:10:147:11 | .myNone | MyEnum |
| patterns.swift:149:10:149:25 | .mySingle(...) | MyEnum |
| patterns.swift:149:19:149:25 | (...) | (Int) |
| patterns.swift:149:20:149:24 | let ... | (Int) |
| patterns.swift:149:24:149:24 | a | (Int) |
| patterns.swift:149:19:149:25 | (...) | Int |
| patterns.swift:149:20:149:24 | let ... | Int |
| patterns.swift:149:24:149:24 | a | Int |
| patterns.swift:151:10:151:30 | .myPair(...) | MyEnum |
| patterns.swift:151:17:151:30 | (...) | (Int, Int) |
| patterns.swift:151:18:151:22 | let ... | Int |
@@ -166,9 +166,9 @@
| patterns.swift:158:22:158:22 | a | Int |
| patterns.swift:158:25:158:25 | _ | MyEnum |
| patterns.swift:162:13:162:28 | .mySingle(...) | MyEnum |
| patterns.swift:162:22:162:28 | (...) | (Int) |
| patterns.swift:162:23:162:27 | let ... | (Int) |
| patterns.swift:162:27:162:27 | x | (Int) |
| patterns.swift:162:22:162:28 | (...) | Int |
| patterns.swift:162:23:162:27 | let ... | Int |
| patterns.swift:162:27:162:27 | x | Int |
| patterns.swift:165:13:165:39 | .myPair(...) | MyEnum |
| patterns.swift:165:26:165:39 | (...) | (Int, Int) |
| patterns.swift:165:27:165:31 | let ... | Int |
18 changes: 9 additions & 9 deletions swift/ql/test/library-tests/ast/PrintAst.expected
Original file line number Diff line number Diff line change
@@ -853,7 +853,7 @@ cfg.swift:
# 144| [ConcreteVarDecl] $match
# 144| Type = Int
# 156| [ConcreteVarDecl] x
# 156| Type = (Int)
# 156| Type = Int
# 163| [NamedFunction] testDefer(x:)
# 163| InterfaceType = (inout Int) -> ()
# 163| getParam(0): [ParamDecl] x
@@ -6399,7 +6399,7 @@ patterns.swift:
# 83| getSubPattern().getFullyUnresolved(): [ParenPattern] (...)
# 83| getSubPattern(): [BindingPattern] let ...
# 83| getVariable(0): [ConcreteVarDecl] a
# 83| Type = (Int)
# 83| Type = Int
# 84| getBody(): [BraceStmt] { ... }
# 84| getElement(0): [CallExpr] call to sink(arg:)
# 84| getFunction(): [DeclRefExpr] sink(arg:)
@@ -6499,7 +6499,7 @@ patterns.swift:
# 105| getSubPattern().getFullyUnresolved(): [ParenPattern] (...)
# 105| getSubPattern(): [BindingPattern] let ...
# 105| getVariable(0): [ConcreteVarDecl] a
# 105| Type = (Int)
# 105| Type = Int
# 106| getBody(): [BraceStmt] { ... }
# 106| getElement(0): [CallExpr] call to sink(arg:)
# 106| getFunction(): [DeclRefExpr] sink(arg:)
@@ -6601,7 +6601,7 @@ patterns.swift:
# 127| getSubPattern().getFullyUnresolved(): [ParenPattern] (...)
# 127| getSubPattern(): [BindingPattern] let ...
# 127| getVariable(0): [ConcreteVarDecl] a
# 127| Type = (Int)
# 127| Type = Int
# 128| getBody(): [BraceStmt] { ... }
# 128| getElement(0): [CallExpr] call to sink(arg:)
# 128| getFunction(): [DeclRefExpr] sink(arg:)
@@ -6704,7 +6704,7 @@ patterns.swift:
# 149| getSubPattern().getFullyUnresolved(): [ParenPattern] (...)
# 149| getSubPattern(): [BindingPattern] let ...
# 149| getVariable(0): [ConcreteVarDecl] a
# 149| Type = (Int)
# 149| Type = Int
# 150| getBody(): [BraceStmt] { ... }
# 150| getElement(0): [CallExpr] call to sink(arg:)
# 150| getFunction(): [DeclRefExpr] sink(arg:)
@@ -6898,25 +6898,25 @@ patterns.swift:
# 181| getBody(): [BraceStmt] { ... }
# 181| getElement(0): [TupleExpr] (...)
# 92| [ConcreteVarDecl] x
# 92| Type = (Int)
# 92| Type = Int
# 95| [ConcreteVarDecl] x
# 95| Type = Int
# 95| [ConcreteVarDecl] y
# 95| Type = Int
# 114| [ConcreteVarDecl] x
# 114| Type = (Int)
# 114| Type = Int
# 117| [ConcreteVarDecl] x
# 117| Type = Int
# 117| [ConcreteVarDecl] y
# 117| Type = Int
# 136| [ConcreteVarDecl] x
# 136| Type = (Int)
# 136| Type = Int
# 139| [ConcreteVarDecl] x
# 139| Type = Int
# 139| [ConcreteVarDecl] y
# 139| Type = Int
# 162| [ConcreteVarDecl] x
# 162| Type = (Int)
# 162| Type = Int
# 165| [ConcreteVarDecl] x
# 165| Type = Int
# 165| [ConcreteVarDecl] y