Swift: MethodLookupExpr.getMethodRef() [codegen'd]

This refactors SelfApplyExpr.getFunction() as MethodLookupExpr().getMethodRef().

This is simpler, because we are not hiding DeclRefExprs or reinventing hidden AST resolution.
This commit is contained in:
Nora Dimitrijević
2022-12-20 23:09:02 -05:00
parent 4900e4030a
commit f3ebb6e03b
10 changed files with 302 additions and 44 deletions

View File

@@ -100,6 +100,7 @@ ql/lib/codeql/swift/elements/expr/CovariantFunctionConversionExpr.qll 687065e862
ql/lib/codeql/swift/elements/expr/CovariantFunctionConversionExprConstructor.qll eac12524819e9fe29074f90ea89fea866023b5ed4a5494345f2b9d8eec531620 71a6eb320630f42403e1e67bb37c39a1bae1c9f6cc38c0f1688a31f3f206d83f
ql/lib/codeql/swift/elements/expr/CovariantReturnConversionExpr.qll e6a7a3ce538c068bd7ab0974b4615acbf00038d3b01dc594372152114559fa44 720fb172ebcb800c70810539c7a80dbdf61acb970277f2b6a54b9159ab4e016e
ql/lib/codeql/swift/elements/expr/CovariantReturnConversionExprConstructor.qll b32a9b3c067d09bd6350efe57215e3b3b9ae598631756878da4a1e474876fc3f bcc963ee556fdd5e1563c305d1bfc6a89e8953243f5dfa1b92144d280ccb3b1a
ql/lib/codeql/swift/elements/expr/DeclRefExprConstructor.qll 1efd7b7de80bdff9c179cdb01777a85369497c5fd02cbdcf41dd9724a663a60b 63dd1e7049091e3e2158fb00498e7b3e82b38abbf5deee56abd00959527ba352
ql/lib/codeql/swift/elements/expr/DefaultArgumentExprConstructor.qll 013827d95e2a9d65830b748093fd8a02da6b6cae78729875f624bf71cc28a4fe 900879fd1c26cfbcea0cd0c3b8f95425644458a8a1dd6628a8bd4bc61bc45809
ql/lib/codeql/swift/elements/expr/DerivedToBaseExpr.qll 782d47d73634aea8ee4ea991acde27180b77535d8e5112d40df77262d9e9a19e e12acd24f48b7b59009615af6a43e061ffc595f1edc55bfe01c1524f30d7be7c
ql/lib/codeql/swift/elements/expr/DerivedToBaseExprConstructor.qll ca74471f6ac2500145de98bb75880450c9185f697f5ce25905271358182a29b3 797b9eaa9d3d56a963d584ba560a67ec94e1a1b10916f0d03f4ad4777e4984f9
@@ -173,6 +174,7 @@ ql/lib/codeql/swift/elements/expr/OpenExistentialExprConstructor.qll c56e5e6f7ae
ql/lib/codeql/swift/elements/expr/OptionalEvaluationExpr.qll 2f46c15d17a50b14e91552be8ac5b72dbdc9f39b8fac9fa068e519ae5c8aa99b 559902efedbf4c5ef24697267c7b48162129b4ab463b41d89bdfb8b94742fa9f
ql/lib/codeql/swift/elements/expr/OptionalEvaluationExprConstructor.qll 4ba0af8f8b4b7920bc1106d069455eb754b7404d9a4bfc361d2ea22e8763f4fe 6d07e7838339290d1a2aec88addd511f01224d7e1d485b08ef4793e01f4b4421
ql/lib/codeql/swift/elements/expr/OptionalTryExprConstructor.qll 60d2f88e2c6fc843353cc52ce1e1c9f7b80978750d0e780361f817b1b2fea895 4eabd9f03dc5c1f956e50e2a7af0535292484acc69692d7c7f771e213609fd04
ql/lib/codeql/swift/elements/expr/OtherConstructorDeclRefExprConstructor.qll cf726ed7ed830e17aaedf1acddf1edc4efc7d72ab9f9580bc89cc8eefbd54d8a 4ef3010dc5500bd503db8aa531d5455a9c80bc30172fb005abc6459b6f66ea00
ql/lib/codeql/swift/elements/expr/OverloadedDeclRefExpr.qll adb49e25cdd87d2e6259399a7ce3a1fbe6eb345f9b8f4e34eb23cb39eb3555da 47b1c6df5397de490f62e96edc0656b1f97c0be73c6b99ecd78b62d46106ce61
ql/lib/codeql/swift/elements/expr/OverloadedDeclRefExprConstructor.qll 2cf79b483f942fbf8aaf9956429b92bf9536e212bb7f7940c2bc1d30e8e8dfd5 f4c16a90e3ab944dded491887779f960e3077f0a8823f17f50f82cf5b9803737
ql/lib/codeql/swift/elements/expr/ParenExprConstructor.qll 6baaa592db57870f5ecd9be632bd3f653c44d72581efd41e8a837916e1590f9e 6f28988d04b2cb69ddcb63fba9ae3166b527803a61c250f97e48ff39a28379f6
@@ -373,7 +375,7 @@ ql/lib/codeql/swift/generated/ErrorElement.qll 4b032abe8ffb71376a29c63e470a52943
ql/lib/codeql/swift/generated/File.qll 61454459f5f1ae378bd4970ad1da4f39f3e696bac8a5eebdd162f131995c5316 3e6805f8858cd55dd0e0d0e5aeab923d6a55292dbf98b0029db1ae0208efe684
ql/lib/codeql/swift/generated/Locatable.qll bdc98b9fb7788f44a4bf7e487ee5bd329473409950a8e9f116d61995615ad849 0b36b4fe45e2aa195e4bb70c50ea95f32f141b8e01e5f23466c6427dd9ab88fb
ql/lib/codeql/swift/generated/Location.qll 851766e474cdfdfa67da42e0031fc42dd60196ff5edd39d82f08d3e32deb84c1 b29b2c37672f5acff15f1d3c5727d902f193e51122327b31bd27ec5f877bca3b
ql/lib/codeql/swift/generated/ParentChild.qll 0cf944fbfc0b7421b474cf3b4591802292008cb2017f72a42d3a58aacafae226 5989b6d3ef54b5977185cc988e6cab4b796485d8cbe089c8714bcebfbdb11f3a
ql/lib/codeql/swift/generated/ParentChild.qll f095bf6545c9408f47e630af4d3df9f6ede7c4167951476729e22b1e4f54b79b 80e186d0ee76757a0f86cdb77703c66a7e6e5c4f3602f5bbb75912865004ca46
ql/lib/codeql/swift/generated/PureSynthConstructors.qll 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98
ql/lib/codeql/swift/generated/Raw.qll 6c68d4d8b51f42a19994476cdf8129bf55b6908dbbc643383506d002bbadb6ba f312416ea50d751501a666c9dc070521055caa5ecc72e460b16ac4fe827a4b6a
ql/lib/codeql/swift/generated/Synth.qll 6a9e6edcc43732b6cf947d88b9562a591a54c651aa8e4f94b8b6139ff3f84b63 a1f37bb361fed57104f8277c8f8b1962a0a54b1f80c2d676e71c40a91d3af529
@@ -505,7 +507,7 @@ ql/lib/codeql/swift/generated/expr/MagicIdentifierLiteralExpr.qll 16f0050128caf9
ql/lib/codeql/swift/generated/expr/MakeTemporarilyEscapableExpr.qll d23bd9ea3b13869d7a7f7eef3c3d1c3c156d384b72c65867a0b955bc517da775 f2fd167ac40f01c092b2b443af1557c92dac32074506f2195d32f60b0e0547d8
ql/lib/codeql/swift/generated/expr/MemberRefExpr.qll 0ece9ffbfd4b15722aa3870014a46afdbf1b1382972fb366d741fafb5473e3de fcb57bd65a94ed4214730339c4ed2b167ec22a3dc9017399596f9b26bdeb95cd
ql/lib/codeql/swift/generated/expr/MetatypeConversionExpr.qll 714ecbc8ac51fdaaa4075388f20fe5063ead9264ca20c4ab8864c48364ef4b42 714ecbc8ac51fdaaa4075388f20fe5063ead9264ca20c4ab8864c48364ef4b42
ql/lib/codeql/swift/generated/expr/MethodLookupExpr.qll 321d45064facd2917fd99a181b1288ec3cec09cf2b8f548d517423228351f414 321d45064facd2917fd99a181b1288ec3cec09cf2b8f548d517423228351f414
ql/lib/codeql/swift/generated/expr/MethodLookupExpr.qll 357bc9ab24830ab60c1456c836e8449ce30ee67fe04e2f2e9437b3211b3b9757 687a3b3e6aeab2d4185f59fc001b3a69e83d96023b0589330a13eeefe3502a80
ql/lib/codeql/swift/generated/expr/NilLiteralExpr.qll 6f44106bc5396c87681676fc3e1239fe052d1a481d0a854afa8b66369668b058 6f44106bc5396c87681676fc3e1239fe052d1a481d0a854afa8b66369668b058
ql/lib/codeql/swift/generated/expr/NumberLiteralExpr.qll 8acc7df8fe83b7d36d66b2feed0b8859bfde873c6a88dd676c9ebed32f39bd04 4bbafc8996b2e95522d8167417668b536b2651817f732554de3083c4857af96a
ql/lib/codeql/swift/generated/expr/ObjCSelectorExpr.qll 8b4f7a9668d1cae4058ba460673b3e0b79f05f2fe871fd992ca1b7ea85f7c09d 629a3057c0ff3ede3a18ea8ea1aa29b24bc780d0dc60b51f99793a6001432a4e
@@ -773,7 +775,7 @@ ql/test/extractor-tests/generated/expr/LazyInitializerExpr/MISSING_SOURCE.txt 7e
ql/test/extractor-tests/generated/expr/MagicIdentifierLiteralExpr/MISSING_SOURCE.txt 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd
ql/test/extractor-tests/generated/expr/MakeTemporarilyEscapableExpr/MISSING_SOURCE.txt 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd
ql/test/extractor-tests/generated/expr/MemberRefExpr/MISSING_SOURCE.txt 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd
ql/test/extractor-tests/generated/expr/MethodLookupExpr/MethodLookupExpr.ql 70598fab2dd87c26fedc9100d73aef9d8b4f60172a2b34c0fd943ab6cf374aa7 83dccc366bd761c01b27ce7e8f52be47743eb45462158997536643d236472d83
ql/test/extractor-tests/generated/expr/MethodLookupExpr/MethodLookupExpr.ql c0c60154b070a8a7ad333544a30f216adf063ae26cac466d60d46b26154eccde 360c9a3ddd9d02a82d0c9de81b8742137d76dba74942f09c9172459565cae19d
ql/test/extractor-tests/generated/expr/MethodLookupExpr/MethodLookupExpr_getMember.ql 859ce0b1f54980e6383ff87d7970eb8a7886d9e1fbe12a8a0a35d216850c6775 24faafdb4a88b0019073c06a1cda8e037154b232a364aa47ae151e95df8a868a
ql/test/extractor-tests/generated/expr/MethodLookupExpr/MethodLookupExpr_getType.ql 3e749535dbf7ae2cd671b3e35b43ca4f6a5bc68c92f89a09a0a9193cd3200b9a 176102d8d9d5a7bf14ac654d98556048996f2311be0bfe67d16229fd22362ba7
ql/test/extractor-tests/generated/expr/NilLiteralExpr/MISSING_SOURCE.txt 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd

View File

@@ -2569,15 +2569,18 @@ private module Impl {
private Element getImmediateChildOfMethodLookupExpr(
MethodLookupExpr e, int index, string partialPredicateCall
) {
exists(int b, int bLookupExpr, int n |
exists(int b, int bLookupExpr, int n, int nMethodRef |
b = 0 and
bLookupExpr =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfLookupExpr(e, i, _)) | i) and
n = bLookupExpr and
nMethodRef = n + 1 and
(
none()
or
result = getImmediateChildOfLookupExpr(e, index - b, partialPredicateCall)
or
index = n and result = e.getImmediateMethodRef() and partialPredicateCall = "MethodRef()"
)
)
}

View File

@@ -1,10 +1,24 @@
// generated by codegen/codegen.py
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.expr.Expr
import codeql.swift.elements.expr.LookupExpr
module Generated {
class MethodLookupExpr extends Synth::TMethodLookupExpr, LookupExpr {
override string getAPrimaryQlClass() { result = "MethodLookupExpr" }
/**
* Gets the the underlying method declaration reference expression.
*
* This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the
* behavior of both the `Immediate` and non-`Immediate` versions.
*/
Expr getImmediateMethodRef() { none() }
/**
* Gets the the underlying method declaration reference expression.
*/
final Expr getMethodRef() { result = getImmediateMethodRef().resolve() }
}
}

View File

@@ -15,6 +15,7 @@
| expressions.swift:7:18:7:18 | $interpolation | DeclRefExpr |
| expressions.swift:7:18:7:18 | &... | InOutExpr |
| expressions.swift:7:18:7:18 | .appendInterpolation(_:) | MethodLookupExpr |
| expressions.swift:7:18:7:18 | appendInterpolation(_:) | DeclRefExpr |
| expressions.swift:7:18:7:20 | call to appendInterpolation(_:) | CallExpr |
| expressions.swift:7:19:7:19 | a | DeclRefExpr |
| expressions.swift:7:21:7:21 | | StringLiteralExpr |
@@ -25,12 +26,14 @@
| expressions.swift:8:15:8:15 | nil | NilLiteralExpr |
| expressions.swift:15:9:15:9 | x | DeclRefExpr |
| expressions.swift:15:9:15:14 | ... .!=(_:_:) ... | BinaryExpr |
| expressions.swift:15:11:15:11 | !=(_:_:) | DeclRefExpr |
| expressions.swift:15:11:15:11 | .!=(_:_:) | MethodLookupExpr |
| expressions.swift:15:11:15:11 | Int.Type | TypeExpr |
| expressions.swift:15:14:15:14 | 0 | IntegerLiteralExpr |
| expressions.swift:16:11:16:11 | AnError.Type | TypeExpr |
| expressions.swift:16:11:16:19 | (Error) ... | ErasureExpr |
| expressions.swift:16:11:16:19 | .failed | MethodLookupExpr |
| expressions.swift:16:19:16:19 | failed | DeclRefExpr |
| expressions.swift:20:1:20:16 | try! ... | ForceTryExpr |
| expressions.swift:20:6:20:6 | failure(_:) | DeclRefExpr |
| expressions.swift:20:6:20:16 | call to failure(_:) | CallExpr |
@@ -41,6 +44,7 @@
| expressions.swift:21:6:21:16 | call to failure(_:) | CallExpr |
| expressions.swift:21:14:21:14 | 11 | IntegerLiteralExpr |
| expressions.swift:27:13:27:13 | Klass.Type | TypeExpr |
| expressions.swift:27:13:27:13 | Klass.init() | DeclRefExpr |
| expressions.swift:27:13:27:13 | Klass.init() | MethodLookupExpr |
| expressions.swift:27:13:27:19 | call to Klass.init() | CallExpr |
| expressions.swift:29:9:29:19 | [...] | DictionaryExpr |
@@ -85,6 +89,7 @@
| expressions.swift:41:10:43:1 | { ... } | ClosureExpr |
| expressions.swift:42:12:42:12 | x | DeclRefExpr |
| expressions.swift:42:12:42:16 | ... .+(_:_:) ... | BinaryExpr |
| expressions.swift:42:14:42:14 | +(_:_:) | DeclRefExpr |
| expressions.swift:42:14:42:14 | .+(_:_:) | MethodLookupExpr |
| expressions.swift:42:14:42:14 | Int.Type | TypeExpr |
| expressions.swift:42:16:42:16 | y | DeclRefExpr |
@@ -93,6 +98,7 @@
| expressions.swift:44:10:46:1 | { ... } | ClosureExpr |
| expressions.swift:45:12:45:12 | x | DeclRefExpr |
| expressions.swift:45:12:45:16 | ... .+(_:_:) ... | BinaryExpr |
| expressions.swift:45:14:45:14 | +(_:_:) | DeclRefExpr |
| expressions.swift:45:14:45:14 | .+(_:_:) | MethodLookupExpr |
| expressions.swift:45:14:45:14 | Int.Type | TypeExpr |
| expressions.swift:45:16:45:16 | y | DeclRefExpr |
@@ -101,6 +107,7 @@
| expressions.swift:47:10:47:27 | { ... } | ClosureExpr |
| expressions.swift:47:19:47:19 | $0 | DeclRefExpr |
| expressions.swift:47:19:47:24 | ... .+(_:_:) ... | BinaryExpr |
| expressions.swift:47:22:47:22 | +(_:_:) | DeclRefExpr |
| expressions.swift:47:22:47:22 | .+(_:_:) | MethodLookupExpr |
| expressions.swift:47:22:47:22 | Int.Type | TypeExpr |
| expressions.swift:47:24:47:24 | $1 | DeclRefExpr |
@@ -109,6 +116,7 @@
| expressions.swift:48:10:48:20 | { ... } | ClosureExpr |
| expressions.swift:48:12:48:12 | $0 | DeclRefExpr |
| expressions.swift:48:12:48:17 | ... .+(_:_:) ... | BinaryExpr |
| expressions.swift:48:15:48:15 | +(_:_:) | DeclRefExpr |
| expressions.swift:48:15:48:15 | .+(_:_:) | MethodLookupExpr |
| expressions.swift:48:15:48:15 | Int.Type | TypeExpr |
| expressions.swift:48:17:48:17 | $1 | DeclRefExpr |
@@ -133,6 +141,7 @@
| expressions.swift:64:8:64:8 | x | DeclRefExpr |
| expressions.swift:64:8:64:12 | ... .<(_:_:) ... | BinaryExpr |
| expressions.swift:64:10:64:10 | .<(_:_:) | MethodLookupExpr |
| expressions.swift:64:10:64:10 | <(_:_:) | DeclRefExpr |
| expressions.swift:64:10:64:10 | Int.Type | TypeExpr |
| expressions.swift:64:12:64:12 | 0 | IntegerLiteralExpr |
| expressions.swift:73:5:73:5 | .xx | MemberRefExpr |
@@ -150,8 +159,10 @@
| expressions.swift:79:5:79:11 | Base.init(x:) | MethodLookupExpr |
| expressions.swift:79:5:79:21 | call to Base.init(x:) | CallExpr |
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr |
| expressions.swift:79:11:79:11 | Base.init(x:) | OtherConstructorDeclRefExpr |
| expressions.swift:79:19:79:19 | 22 | IntegerLiteralExpr |
| expressions.swift:83:15:83:15 | Derived.Type | TypeExpr |
| expressions.swift:83:15:83:15 | Derived.init() | DeclRefExpr |
| expressions.swift:83:15:83:15 | Derived.init() | MethodLookupExpr |
| expressions.swift:83:15:83:23 | call to Derived.init() | CallExpr |
| expressions.swift:84:1:84:1 | _ | DiscardAssignmentExpr |
@@ -170,12 +181,16 @@
| expressions.swift:92:14:92:44 | call to passRetained(_:) | CallExpr |
| expressions.swift:92:14:92:46 | .toOpaque() | MethodLookupExpr |
| expressions.swift:92:14:92:55 | call to toOpaque() | CallExpr |
| expressions.swift:92:24:92:24 | passRetained(_:) | DeclRefExpr |
| expressions.swift:92:37:92:37 | ToPtr.Type | TypeExpr |
| expressions.swift:92:37:92:37 | ToPtr.init() | DeclRefExpr |
| expressions.swift:92:37:92:37 | ToPtr.init() | MethodLookupExpr |
| expressions.swift:92:37:92:43 | call to ToPtr.init() | CallExpr |
| expressions.swift:92:46:92:46 | toOpaque() | DeclRefExpr |
| expressions.swift:93:1:93:16 | Unmanaged<ToPtr>.Type | TypeExpr |
| expressions.swift:93:1:93:18 | .fromOpaque(_:) | MethodLookupExpr |
| expressions.swift:93:1:93:35 | call to fromOpaque(_:) | CallExpr |
| expressions.swift:93:18:93:18 | fromOpaque(_:) | DeclRefExpr |
| expressions.swift:93:29:93:29 | (UnsafeRawPointer) ... | PointerToPointerExpr |
| expressions.swift:93:29:93:29 | opaque | DeclRefExpr |
| expressions.swift:99:14:99:14 | 0 | IntegerLiteralExpr |
@@ -229,12 +244,14 @@
| expressions.swift:158:3:158:8 | ... = ... | AssignExpr |
| expressions.swift:158:7:158:7 | .~(_:) | MethodLookupExpr |
| expressions.swift:158:7:158:7 | Int.Type | TypeExpr |
| expressions.swift:158:7:158:7 | ~(_:) | DeclRefExpr |
| expressions.swift:158:7:158:8 | call to ~(_:) | PrefixUnaryExpr |
| expressions.swift:158:8:158:8 | 1 | IntegerLiteralExpr |
| expressions.swift:159:3:159:3 | _ | DiscardAssignmentExpr |
| expressions.swift:159:3:159:11 | ... = ... | AssignExpr |
| expressions.swift:159:7:159:7 | 1 | IntegerLiteralExpr |
| expressions.swift:159:7:159:11 | ... .&(_:_:) ... | BinaryExpr |
| expressions.swift:159:9:159:9 | &(_:_:) | DeclRefExpr |
| expressions.swift:159:9:159:9 | .&(_:_:) | MethodLookupExpr |
| expressions.swift:159:9:159:9 | Int.Type | TypeExpr |
| expressions.swift:159:11:159:11 | 2 | IntegerLiteralExpr |
@@ -244,6 +261,7 @@
| expressions.swift:160:7:160:11 | ... .\|(_:_:) ... | BinaryExpr |
| expressions.swift:160:9:160:9 | .\|(_:_:) | MethodLookupExpr |
| expressions.swift:160:9:160:9 | Int.Type | TypeExpr |
| expressions.swift:160:9:160:9 | \|(_:_:) | DeclRefExpr |
| expressions.swift:160:11:160:11 | 2 | IntegerLiteralExpr |
| expressions.swift:161:3:161:3 | _ | DiscardAssignmentExpr |
| expressions.swift:161:3:161:11 | ... = ... | AssignExpr |
@@ -251,12 +269,14 @@
| expressions.swift:161:7:161:11 | ... .^(_:_:) ... | BinaryExpr |
| expressions.swift:161:9:161:9 | .^(_:_:) | MethodLookupExpr |
| expressions.swift:161:9:161:9 | Int.Type | TypeExpr |
| expressions.swift:161:9:161:9 | ^(_:_:) | DeclRefExpr |
| expressions.swift:161:11:161:11 | 2 | IntegerLiteralExpr |
| expressions.swift:162:3:162:3 | _ | DiscardAssignmentExpr |
| expressions.swift:162:3:162:12 | ... = ... | AssignExpr |
| expressions.swift:162:7:162:7 | 1 | IntegerLiteralExpr |
| expressions.swift:162:7:162:12 | ... .<<(_:_:) ... | BinaryExpr |
| expressions.swift:162:9:162:9 | .<<(_:_:) | MethodLookupExpr |
| expressions.swift:162:9:162:9 | <<(_:_:) | DeclRefExpr |
| expressions.swift:162:9:162:9 | Int.Type | TypeExpr |
| expressions.swift:162:12:162:12 | 0 | IntegerLiteralExpr |
| expressions.swift:163:3:163:3 | _ | DiscardAssignmentExpr |
@@ -264,5 +284,6 @@
| expressions.swift:163:7:163:7 | 1 | IntegerLiteralExpr |
| expressions.swift:163:7:163:12 | ... .>>(_:_:) ... | BinaryExpr |
| expressions.swift:163:9:163:9 | .>>(_:_:) | MethodLookupExpr |
| expressions.swift:163:9:163:9 | >>(_:_:) | DeclRefExpr |
| expressions.swift:163:9:163:9 | Int.Type | TypeExpr |
| expressions.swift:163:12:163:12 | 0 | IntegerLiteralExpr |

View File

@@ -1,25 +1,33 @@
| expressions.swift:7:11:7:11 | $interpolation | OrdinarySemantics |
| expressions.swift:7:18:7:18 | $interpolation | OrdinarySemantics |
| expressions.swift:7:18:7:18 | appendInterpolation(_:) | OrdinarySemantics |
| expressions.swift:7:19:7:19 | a | OrdinarySemantics |
| expressions.swift:7:21:7:21 | $interpolation | OrdinarySemantics |
| expressions.swift:15:9:15:9 | x | OrdinarySemantics |
| expressions.swift:15:11:15:11 | !=(_:_:) | OrdinarySemantics |
| expressions.swift:16:19:16:19 | failed | OrdinarySemantics |
| expressions.swift:20:6:20:6 | failure(_:) | OrdinarySemantics |
| expressions.swift:21:6:21:6 | failure(_:) | OrdinarySemantics |
| expressions.swift:27:13:27:13 | Klass.init() | OrdinarySemantics |
| expressions.swift:35:1:35:1 | print(_:separator:terminator:) | OrdinarySemantics |
| expressions.swift:35:7:35:7 | d | OrdinarySemantics |
| expressions.swift:35:7:35:12 | ...[...] | OrdinarySemantics |
| expressions.swift:38:3:38:3 | closure | OrdinarySemantics |
| expressions.swift:41:1:41:1 | closured(closure:) | OrdinarySemantics |
| expressions.swift:42:12:42:12 | x | OrdinarySemantics |
| expressions.swift:42:14:42:14 | +(_:_:) | OrdinarySemantics |
| expressions.swift:42:16:42:16 | y | OrdinarySemantics |
| expressions.swift:44:1:44:1 | closured(closure:) | OrdinarySemantics |
| expressions.swift:45:12:45:12 | x | OrdinarySemantics |
| expressions.swift:45:14:45:14 | +(_:_:) | OrdinarySemantics |
| expressions.swift:45:16:45:16 | y | OrdinarySemantics |
| expressions.swift:47:1:47:1 | closured(closure:) | OrdinarySemantics |
| expressions.swift:47:19:47:19 | $0 | OrdinarySemantics |
| expressions.swift:47:22:47:22 | +(_:_:) | OrdinarySemantics |
| expressions.swift:47:24:47:24 | $1 | OrdinarySemantics |
| expressions.swift:48:1:48:1 | closured(closure:) | OrdinarySemantics |
| expressions.swift:48:12:48:12 | $0 | OrdinarySemantics |
| expressions.swift:48:15:48:15 | +(_:_:) | OrdinarySemantics |
| expressions.swift:48:17:48:17 | $1 | OrdinarySemantics |
| expressions.swift:59:1:59:1 | unsafeFunction(pointer:) | OrdinarySemantics |
| expressions.swift:59:26:59:26 | myNumber | OrdinarySemantics |
@@ -28,15 +36,21 @@
| expressions.swift:60:35:60:35 | unsafeFunction(pointer:) | OrdinarySemantics |
| expressions.swift:60:59:60:59 | $0 | OrdinarySemantics |
| expressions.swift:64:8:64:8 | x | OrdinarySemantics |
| expressions.swift:64:10:64:10 | <(_:_:) | OrdinarySemantics |
| expressions.swift:73:5:73:5 | .xx | DirectToStorage |
| expressions.swift:73:5:73:5 | self | OrdinarySemantics |
| expressions.swift:73:10:73:10 | x | OrdinarySemantics |
| expressions.swift:77:7:77:7 | _unimplementedInitializer(className:initName:file:line:column:) | OrdinarySemantics |
| expressions.swift:83:15:83:15 | Derived.init() | OrdinarySemantics |
| expressions.swift:84:5:84:5 | derived | OrdinarySemantics |
| expressions.swift:84:5:84:13 | .xx | OrdinarySemantics |
| expressions.swift:87:1:87:1 | opt | OrdinarySemantics |
| expressions.swift:88:1:88:1 | d | OrdinarySemantics |
| expressions.swift:88:1:88:6 | ...[...] | OrdinarySemantics |
| expressions.swift:92:24:92:24 | passRetained(_:) | OrdinarySemantics |
| expressions.swift:92:37:92:37 | ToPtr.init() | OrdinarySemantics |
| expressions.swift:92:46:92:46 | toOpaque() | OrdinarySemantics |
| expressions.swift:93:18:93:18 | fromOpaque(_:) | OrdinarySemantics |
| expressions.swift:93:29:93:29 | opaque | OrdinarySemantics |
| expressions.swift:131:3:131:3 | hp | OrdinarySemantics |
| expressions.swift:131:3:131:6 | .settableField | OrdinarySemantics |
@@ -60,3 +74,9 @@
| expressions.swift:153:35:153:35 | keyPathB | OrdinarySemantics |
| expressions.swift:154:22:154:22 | a | OrdinarySemantics |
| expressions.swift:154:33:154:33 | keyPathB | OrdinarySemantics |
| expressions.swift:158:7:158:7 | ~(_:) | OrdinarySemantics |
| expressions.swift:159:9:159:9 | &(_:_:) | OrdinarySemantics |
| expressions.swift:160:9:160:9 | \|(_:_:) | OrdinarySemantics |
| expressions.swift:161:9:161:9 | ^(_:_:) | OrdinarySemantics |
| expressions.swift:162:9:162:9 | <<(_:_:) | OrdinarySemantics |
| expressions.swift:163:9:163:9 | >>(_:_:) | OrdinarySemantics |

View File

@@ -1,32 +1,32 @@
| file://:0:0:0:0 | UnownedSerialExecutor.init(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | UnownedSerialExecutor.Type | hasMember: | yes |
| method_lookups.swift:7:13:7:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:7:13:7:13 | self | hasMember: | no |
| method_lookups.swift:7:13:7:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:16:13:16:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:16:13:16:13 | self | hasMember: | no |
| method_lookups.swift:16:13:16:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:27:13:27:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:27:13:27:13 | self | hasMember: | no |
| method_lookups.swift:27:13:27:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:32:3:32:5 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:32:3:32:3 | X.Type | hasMember: | yes |
| method_lookups.swift:33:3:33:5 | .bar() | hasType: | yes | getBase: | method_lookups.swift:33:3:33:3 | X.Type | hasMember: | yes |
| method_lookups.swift:34:3:34:3 | X.init() | hasType: | yes | getBase: | method_lookups.swift:34:3:34:3 | X.Type | hasMember: | yes |
| method_lookups.swift:34:3:34:7 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:34:3:34:5 | call to X.init() | hasMember: | yes |
| method_lookups.swift:36:11:36:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:36:11:36:11 | X.Type | hasMember: | no |
| method_lookups.swift:36:13:36:13 | .bar() | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:37:11:37:11 | X.init() | hasType: | yes | getBase: | method_lookups.swift:37:11:37:11 | X.Type | hasMember: | yes |
| method_lookups.swift:37:11:37:15 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:37:11:37:13 | call to X.init() | hasMember: | no |
| method_lookups.swift:37:15:37:15 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:40:1:40:1 | Task<Success, Never>.init(priority:operation:) | hasType: | yes | getBase: | method_lookups.swift:40:1:40:1 | Task<(), Never>.Type | hasMember: | yes |
| method_lookups.swift:41:3:41:5 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:41:3:41:3 | Y.Type | hasMember: | yes |
| method_lookups.swift:42:9:42:9 | Y.init() | hasType: | yes | getBase: | method_lookups.swift:42:9:42:9 | Y.Type | hasMember: | yes |
| method_lookups.swift:42:9:42:13 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:42:9:42:11 | call to Y.init() | hasMember: | yes |
| method_lookups.swift:44:11:44:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:44:11:44:11 | Y.Type | hasMember: | no |
| method_lookups.swift:44:13:44:13 | .foo(_:_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:47:1:47:1 | Task<Success, Never>.init(priority:operation:) | hasType: | yes | getBase: | method_lookups.swift:47:1:47:1 | Task<(), Never>.Type | hasMember: | yes |
| method_lookups.swift:48:9:48:11 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:48:9:48:9 | Z.Type | hasMember: | yes |
| method_lookups.swift:49:9:49:11 | .bar() | hasType: | yes | getBase: | method_lookups.swift:49:9:49:9 | Z.Type | hasMember: | yes |
| method_lookups.swift:50:9:50:9 | Z.init() | hasType: | yes | getBase: | method_lookups.swift:50:9:50:9 | Z.Type | hasMember: | yes |
| method_lookups.swift:50:9:50:13 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:50:9:50:11 | call to Z.init() | hasMember: | yes |
| method_lookups.swift:52:11:52:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:52:11:52:11 | Z.Type | hasMember: | no |
| method_lookups.swift:52:13:52:13 | .bar() | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| method_lookups.swift:53:11:53:23 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:53:18:53:20 | call to Z.init() | hasMember: | no |
| method_lookups.swift:53:18:53:18 | Z.init() | hasType: | yes | getBase: | method_lookups.swift:53:18:53:18 | Z.Type | hasMember: | yes |
| method_lookups.swift:53:23:53:23 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes |
| file://:0:0:0:0 | UnownedSerialExecutor.init(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | UnownedSerialExecutor.Type | hasMember: | yes | getMethodRef: | file://:0:0:0:0 | UnownedSerialExecutor.init(_:) |
| method_lookups.swift:7:13:7:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:7:13:7:13 | self | hasMember: | no | getMethodRef: | method_lookups.swift:7:13:7:13 | { ... } |
| method_lookups.swift:7:13:7:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:7:13:7:13 | baz(_:) |
| method_lookups.swift:16:13:16:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:16:13:16:13 | self | hasMember: | no | getMethodRef: | method_lookups.swift:16:13:16:13 | { ... } |
| method_lookups.swift:16:13:16:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:16:13:16:13 | baz(_:) |
| method_lookups.swift:27:13:27:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:27:13:27:13 | self | hasMember: | no | getMethodRef: | method_lookups.swift:27:13:27:13 | { ... } |
| method_lookups.swift:27:13:27:13 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:27:13:27:13 | baz(_:) |
| method_lookups.swift:32:3:32:5 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:32:3:32:3 | X.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:32:5:32:5 | foo(_:_:) |
| method_lookups.swift:33:3:33:5 | .bar() | hasType: | yes | getBase: | method_lookups.swift:33:3:33:3 | X.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:33:5:33:5 | bar() |
| method_lookups.swift:34:3:34:3 | X.init() | hasType: | yes | getBase: | method_lookups.swift:34:3:34:3 | X.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:34:3:34:3 | X.init() |
| method_lookups.swift:34:3:34:7 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:34:3:34:5 | call to X.init() | hasMember: | yes | getMethodRef: | method_lookups.swift:34:7:34:7 | baz(_:) |
| method_lookups.swift:36:11:36:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:36:11:36:11 | X.Type | hasMember: | no | getMethodRef: | method_lookups.swift:36:13:36:13 | { ... } |
| method_lookups.swift:36:13:36:13 | .bar() | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:36:13:36:13 | bar() |
| method_lookups.swift:37:11:37:11 | X.init() | hasType: | yes | getBase: | method_lookups.swift:37:11:37:11 | X.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:37:11:37:11 | X.init() |
| method_lookups.swift:37:11:37:15 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:37:11:37:13 | call to X.init() | hasMember: | no | getMethodRef: | method_lookups.swift:37:15:37:15 | { ... } |
| method_lookups.swift:37:15:37:15 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:37:15:37:15 | baz(_:) |
| method_lookups.swift:40:1:40:1 | Task<Success, Never>.init(priority:operation:) | hasType: | yes | getBase: | method_lookups.swift:40:1:40:1 | Task<(), Never>.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:40:1:40:1 | Task<Success, Never>.init(priority:operation:) |
| method_lookups.swift:41:3:41:5 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:41:3:41:3 | Y.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:41:5:41:5 | foo(_:_:) |
| method_lookups.swift:42:9:42:9 | Y.init() | hasType: | yes | getBase: | method_lookups.swift:42:9:42:9 | Y.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:42:9:42:9 | Y.init() |
| method_lookups.swift:42:9:42:13 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:42:9:42:11 | call to Y.init() | hasMember: | yes | getMethodRef: | method_lookups.swift:42:13:42:13 | baz(_:) |
| method_lookups.swift:44:11:44:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:44:11:44:11 | Y.Type | hasMember: | no | getMethodRef: | method_lookups.swift:44:13:44:13 | { ... } |
| method_lookups.swift:44:13:44:13 | .foo(_:_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:44:13:44:13 | foo(_:_:) |
| method_lookups.swift:47:1:47:1 | Task<Success, Never>.init(priority:operation:) | hasType: | yes | getBase: | method_lookups.swift:47:1:47:1 | Task<(), Never>.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:47:1:47:1 | Task<Success, Never>.init(priority:operation:) |
| method_lookups.swift:48:9:48:11 | .foo(_:_:) | hasType: | yes | getBase: | method_lookups.swift:48:9:48:9 | Z.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:48:11:48:11 | foo(_:_:) |
| method_lookups.swift:49:9:49:11 | .bar() | hasType: | yes | getBase: | method_lookups.swift:49:9:49:9 | Z.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:49:11:49:11 | bar() |
| method_lookups.swift:50:9:50:9 | Z.init() | hasType: | yes | getBase: | method_lookups.swift:50:9:50:9 | Z.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:50:9:50:9 | Z.init() |
| method_lookups.swift:50:9:50:13 | .baz(_:) | hasType: | yes | getBase: | method_lookups.swift:50:9:50:11 | call to Z.init() | hasMember: | yes | getMethodRef: | method_lookups.swift:50:13:50:13 | baz(_:) |
| method_lookups.swift:52:11:52:13 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:52:11:52:11 | Z.Type | hasMember: | no | getMethodRef: | method_lookups.swift:52:13:52:13 | { ... } |
| method_lookups.swift:52:13:52:13 | .bar() | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:52:13:52:13 | bar() |
| method_lookups.swift:53:11:53:23 | (no string representation) | hasType: | yes | getBase: | method_lookups.swift:53:18:53:20 | call to Z.init() | hasMember: | no | getMethodRef: | method_lookups.swift:53:23:53:23 | { ... } |
| method_lookups.swift:53:18:53:18 | Z.init() | hasType: | yes | getBase: | method_lookups.swift:53:18:53:18 | Z.Type | hasMember: | yes | getMethodRef: | method_lookups.swift:53:18:53:18 | Z.init() |
| method_lookups.swift:53:23:53:23 | .baz(_:) | hasType: | yes | getBase: | file://:0:0:0:0 | self | hasMember: | yes | getMethodRef: | method_lookups.swift:53:23:53:23 | baz(_:) |

View File

@@ -2,11 +2,13 @@
import codeql.swift.elements
import TestUtils
from MethodLookupExpr x, string hasType, Expr getBase, string hasMember
from MethodLookupExpr x, string hasType, Expr getBase, string hasMember, Expr getMethodRef
where
toBeTested(x) and
not x.isUnknown() and
(if x.hasType() then hasType = "yes" else hasType = "no") and
getBase = x.getBase() and
if x.hasMember() then hasMember = "yes" else hasMember = "no"
select x, "hasType:", hasType, "getBase:", getBase, "hasMember:", hasMember
(if x.hasMember() then hasMember = "yes" else hasMember = "no") and
getMethodRef = x.getMethodRef()
select x, "hasType:", hasType, "getBase:", getBase, "hasMember:", hasMember, "getMethodRef:",
getMethodRef

View File

@@ -8,20 +8,25 @@
| types.swift:3:7:3:11 | ... .+(_:_:) ... | Int |
| types.swift:3:7:3:11 | [...] | Any... |
| types.swift:3:7:3:11 | [...] | Any... |
| types.swift:3:9:3:9 | +(_:_:) | (Int.Type) -> (Int, Int) -> Int |
| types.swift:3:9:3:9 | .+(_:_:) | (Int, Int) -> Int |
| types.swift:3:9:3:9 | Int.Type | Int.Type |
| types.swift:3:11:3:11 | 10 | Int |
| types.swift:7:16:7:16 | X.Type | X.Type |
| types.swift:7:16:7:16 | X.init() | () -> X |
| types.swift:7:16:7:16 | X.init() | (X.Type) -> () -> X |
| types.swift:7:16:7:18 | call to X.init() | X |
| types.swift:13:17:13:17 | C.Type | C.Type |
| types.swift:13:17:13:17 | C.init() | () -> C |
| types.swift:13:17:13:17 | C.init() | (C.Type) -> () -> C |
| types.swift:13:17:13:19 | call to C.init() | C |
| types.swift:14:22:14:24 | C.Nested.Type | C.Nested.Type |
| types.swift:14:22:14:24 | C.Nested.init() | () -> C.Nested |
| types.swift:14:22:14:31 | call to C.Nested.init() | C.Nested |
| types.swift:14:24:14:24 | C.Nested.init() | (C.Nested.Type) -> () -> C.Nested |
| types.swift:17:10:17:10 | x | Int |
| types.swift:17:10:17:14 | ... .+(_:_:) ... | Int |
| types.swift:17:12:17:12 | +(_:_:) | (Int.Type) -> (Int, Int) -> Int |
| types.swift:17:12:17:12 | .+(_:_:) | (Int, Int) -> Int |
| types.swift:17:12:17:12 | Int.Type | Int.Type |
| types.swift:17:14:17:14 | y | Int |

File diff suppressed because it is too large Load Diff

View File

@@ -62,6 +62,7 @@ methodlookup.swift:
#-----| getResult(): [CallExpr] call to UnownedSerialExecutor.init(_:)
#-----| getFunction(): [MethodLookupExpr] UnownedSerialExecutor.init(_:)
#-----| getBase(): [TypeExpr] UnownedSerialExecutor.Type
#-----| getMethodRef(): [DeclRefExpr] UnownedSerialExecutor.init(_:)
#-----| getArgument(0): [Argument] : call to buildDefaultActorExecutorRef(_:)
#-----| getExpr(): [CallExpr] call to buildDefaultActorExecutorRef(_:)
#-----| getFunction(): [DeclRefExpr] buildDefaultActorExecutorRef(_:)
@@ -103,6 +104,7 @@ methodlookup.swift:
# 23| getFunction(): [MethodLookupExpr] Foo.init()
# 23| getBase(): [TypeExpr] Foo.Type
# 23| getTypeRepr(): [TypeRepr] Foo
# 23| getMethodRef(): [DeclRefExpr] Foo.init()
# 23| getPattern(0): [NamedPattern] foo
# 23| getElement(1): [ConcreteVarDecl] foo
# 23| Type = Foo
@@ -112,9 +114,11 @@ methodlookup.swift:
# 24| getFunction(): [MethodLookupExpr] Foo.init()
# 24| getBase(): [TypeExpr] Foo.Type
# 24| getTypeRepr(): [TypeRepr] Foo
# 24| getMethodRef(): [DeclRefExpr] Foo.init()
# 26| getElement(3): [CallExpr] call to instanceMethod()
# 26| getFunction(): [MethodLookupExpr] .instanceMethod()
# 26| getBase(): [DeclRefExpr] foo
# 26| getMethodRef(): [DeclRefExpr] instanceMethod()
# 27| getElement(4): [CallExpr] call to { ... }
# 27| getFunction(): [CallExpr] call to Foo.instanceMethod()
# 27| getFunction(): [DotSyntaxBaseIgnoredExpr] Foo.instanceMethod()
@@ -131,22 +135,26 @@ methodlookup.swift:
# 27| getResult(): [CallExpr] call to instanceMethod()
# 27| getFunction(): [MethodLookupExpr] .instanceMethod()
#-----| getBase(): [DeclRefExpr] self
# 27| getMethodRef(): [DeclRefExpr] instanceMethod()
# 27| getArgument(0): [Argument] : foo
# 27| getExpr(): [DeclRefExpr] foo
# 29| getElement(5): [CallExpr] call to classMethod()
# 29| getFunction(): [MethodLookupExpr] .classMethod()
# 29| getBase(): [TypeExpr] Foo.Type
# 29| getTypeRepr(): [TypeRepr] Foo
# 29| getMethodRef(): [DeclRefExpr] classMethod()
# 30| getElement(6): [CallExpr] call to staticMethod()
# 30| getFunction(): [MethodLookupExpr] .staticMethod()
# 30| getBase(): [TypeExpr] Foo.Type
# 30| getTypeRepr(): [TypeRepr] Foo
# 30| getMethodRef(): [DeclRefExpr] staticMethod()
# 33| [TopLevelCodeDecl] { ... }
# 33| getBody(): [BraceStmt] { ... }
# 33| getElement(0): [CallExpr] call to Task<Success, Never>.init(priority:operation:)
# 33| getFunction(): [MethodLookupExpr] Task<Success, Never>.init(priority:operation:)
# 33| getBase(): [TypeExpr] Task<(), Never>.Type
# 33| getTypeRepr(): [TypeRepr] Task<(), Never>
# 33| getMethodRef(): [DeclRefExpr] Task<Success, Never>.init(priority:operation:)
# 33| getArgument(0): [Argument] priority: default priority
# 33| getExpr(): [DefaultArgumentExpr] default priority
# 33| getArgument(1): [Argument] operation: { ... }
@@ -157,6 +165,7 @@ methodlookup.swift:
# 34| getFunction(): [MethodLookupExpr] Bar.init()
# 34| getBase(): [TypeExpr] Bar.Type
# 34| getTypeRepr(): [TypeRepr] Bar
# 34| getMethodRef(): [DeclRefExpr] Bar.init()
# 34| getPattern(0): [NamedPattern] bar
# 34| getElement(1): [ConcreteVarDecl] bar
# 34| Type = Bar
@@ -166,14 +175,17 @@ methodlookup.swift:
# 35| getFunction(): [MethodLookupExpr] Bar.init()
# 35| getBase(): [TypeExpr] Bar.Type
# 35| getTypeRepr(): [TypeRepr] Bar
# 35| getMethodRef(): [DeclRefExpr] Bar.init()
# 37| getElement(3): [CallExpr] call to instanceMethod()
# 37| getFunction(): [MethodLookupExpr] .instanceMethod()
# 37| getBase(): [DeclRefExpr] bar
# 37| getMethodRef(): [DeclRefExpr] instanceMethod()
# 37| getElement(3).getFullyConverted(): [AwaitExpr] await ...
# 40| getElement(4): [CallExpr] call to staticMethod()
# 40| getFunction(): [MethodLookupExpr] .staticMethod()
# 40| getBase(): [TypeExpr] Bar.Type
# 40| getTypeRepr(): [TypeRepr] Bar
# 40| getMethodRef(): [DeclRefExpr] staticMethod()
# 33| [NilLiteralExpr] nil
# 38| [Comment] // Bar.instanceMethod(bar2)() // error: actor-isolated instance method 'instanceMethod()' can not be referenced from a non-isolated context
# 38|
@@ -183,6 +195,7 @@ methodlookup.swift:
# 43| getFunction(): [MethodLookupExpr] Task<Success, Never>.init(priority:operation:)
# 43| getBase(): [TypeExpr] Task<(), Never>.Type
# 43| getTypeRepr(): [TypeRepr] Task<(), Never>
# 43| getMethodRef(): [DeclRefExpr] Task<Success, Never>.init(priority:operation:)
# 43| getArgument(0): [Argument] priority: default priority
# 43| getExpr(): [DefaultArgumentExpr] default priority
# 43| getArgument(1): [Argument] operation: { ... }
@@ -193,6 +206,8 @@ methodlookup.swift:
# 44| getFunction(): [MethodLookupExpr] Baz.init()
# 44| getBase(): [TypeExpr] Baz.Type
# 44| getTypeRepr(): [TypeRepr] Baz
# 44| getMethodRef(): [DeclRefExpr] Baz.init()
# 44| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> Baz) ...
# 44| getInit(0).getFullyConverted(): [AwaitExpr] await ...
# 44| getPattern(0): [NamedPattern] baz
# 44| getElement(1): [ConcreteVarDecl] baz
@@ -203,10 +218,14 @@ methodlookup.swift:
# 45| getFunction(): [MethodLookupExpr] Baz.init()
# 45| getBase(): [TypeExpr] Baz.Type
# 45| getTypeRepr(): [TypeRepr] Baz
# 45| getMethodRef(): [DeclRefExpr] Baz.init()
# 45| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> Baz) ...
# 45| getSource().getFullyConverted(): [AwaitExpr] await ...
# 47| getElement(3): [CallExpr] call to instanceMethod()
# 47| getFunction(): [MethodLookupExpr] .instanceMethod()
# 47| getBase(): [DeclRefExpr] baz
# 47| getMethodRef(): [DeclRefExpr] instanceMethod()
# 47| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz) -> @MainActor () -> ()) ...
# 47| getElement(3).getFullyConverted(): [AwaitExpr] await ...
# 48| getElement(4): [CallExpr] call to { ... }
# 48| getFunction(): [CallExpr] call to Baz.instanceMethod()
@@ -224,6 +243,7 @@ methodlookup.swift:
# 48| getResult(): [CallExpr] call to instanceMethod()
# 48| getFunction(): [MethodLookupExpr] .instanceMethod()
#-----| getBase(): [DeclRefExpr] self
# 48| getMethodRef(): [DeclRefExpr] instanceMethod()
# 48| getArgument(0): [Argument] : baz
# 48| getExpr(): [DeclRefExpr] baz
# 48| getElement(4).getFullyConverted(): [AwaitExpr] await ...
@@ -231,19 +251,18 @@ methodlookup.swift:
# 50| getFunction(): [MethodLookupExpr] .classMethod()
# 50| getBase(): [TypeExpr] Baz.Type
# 50| getTypeRepr(): [TypeRepr] Baz
# 50| getMethodRef(): [DeclRefExpr] classMethod()
# 50| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> ()) ...
# 50| getElement(5).getFullyConverted(): [AwaitExpr] await ...
# 51| getElement(6): [CallExpr] call to staticMethod()
# 51| getFunction(): [MethodLookupExpr] .staticMethod()
# 51| getBase(): [TypeExpr] Baz.Type
# 51| getTypeRepr(): [TypeRepr] Baz
# 51| getMethodRef(): [DeclRefExpr] staticMethod()
# 51| getMethodRef().getFullyConverted(): [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> ()) ...
# 51| getElement(6).getFullyConverted(): [AwaitExpr] await ...
# 43| [NilLiteralExpr] nil
# 44| [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> Baz) ...
# 45| [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> Baz) ...
# 47| [FunctionConversionExpr] ((Baz) -> @MainActor () -> ()) ...
# 47| [Comment] // DotSyntaxCallExpr
# 47|
# 48| [Comment] // DotSyntaxBaseIgnoredExpr
# 48|
# 50| [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> ()) ...
# 51| [FunctionConversionExpr] ((Baz.Type) -> @MainActor () -> ()) ...