@@ -35,13 +35,17 @@ class CallTests extends SwiftCompilerSrc2CpgSuite {
3535 val List (barCall) = cpg.call.nameExact(" bar" ).l
3636 barCall.methodFullName shouldBe x2cpg.Defines .DynamicCallUnknownFullName
3737 barCall.signature shouldBe " "
38+ barCall.dispatchType shouldBe DispatchTypes .DYNAMIC_DISPATCH
39+
3840 val List (barCallReceiverCall) = barCall.receiver.isIdentifier.l
3941 barCallReceiverCall.name shouldBe " self"
4042 barCallReceiverCall.typeFullName shouldBe " Sources/main.swift:<global>.Foo"
4143
4244 val List (methodCall) = cpg.call.nameExact(" method" ).l
4345 methodCall.methodFullName shouldBe x2cpg.Defines .DynamicCallUnknownFullName
4446 methodCall.signature shouldBe " "
47+ methodCall.dispatchType shouldBe DispatchTypes .DYNAMIC_DISPATCH
48+
4549 val List (methodCallReceiverCall) = methodCall.receiver.isIdentifier.l
4650 methodCallReceiverCall.name shouldBe " other"
4751 methodCallReceiverCall.typeFullName shouldBe " ANY"
@@ -64,13 +68,17 @@ class CallTests extends SwiftCompilerSrc2CpgSuite {
6468 val List (fooCall) = cpg.call.nameExact(" foo" ).l
6569 fooCall.methodFullName shouldBe " SwiftTest.Foo.foo:()->()"
6670 fooCall.signature shouldBe " ()->()"
71+ fooCall.dispatchType shouldBe DispatchTypes .DYNAMIC_DISPATCH
72+
6773 val List (fooCallReceiver) = fooCall.receiver.isIdentifier.l
6874 fooCallReceiver.name shouldBe " self"
6975 fooCallReceiver.typeFullName shouldBe " SwiftTest.Foo"
7076
7177 val List (barCall) = cpg.call.nameExact(" bar" ).l
7278 barCall.methodFullName shouldBe " SwiftTest.Foo.bar:()->Swift.String"
7379 barCall.signature shouldBe " ()->Swift.String"
80+ barCall.dispatchType shouldBe DispatchTypes .DYNAMIC_DISPATCH
81+
7482 val List (barCallReceiverCall) = barCall.receiver.isIdentifier.l
7583 barCallReceiverCall.name shouldBe " self"
7684 barCallReceiverCall.typeFullName shouldBe " SwiftTest.Foo"
0 commit comments