You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
If it's mapped as a generic function in C#, this wouldn't work out right.
Likely the best thing to do is to instead make the function return type object and let the caller deal with it.
The text was updated successfully, but these errors were encountered:
I looked into this - it's...not easy. The problem is that in order to marshal something useful out of the ExistentialContainer you have to have a real C# type because we need a C# type to represent the type of the metadata. The problem is that in pulling out the actual object type, we have to ask questions like "how much memory do we need for the type?" and we don't have that.
In theory we could grab the SwiftMetatype out of the ExistentialContainer and map that to the type, but that map just doesn't exist and would be onerous to create. So, no?
This is a semantic impedance mismatch in play here.
In C# if I declare this method:
It is up to the caller to decide what the type of T is.
In swift, if I write this method:
It is up to the callee to decide what the return type is.
In other words, we could write this method in swift:
If it's mapped as a generic function in C#, this wouldn't work out right.
Likely the best thing to do is to instead make the function return type
object
and let the caller deal with it.The text was updated successfully, but these errors were encountered: