-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to create function that returns array? #37
Comments
FYI and anyone that might look for this: |
Inputs and outputs must be specified by a TupleType, as all Functions accept a Tuple of arguments and return a Tuple of return values. What you're looking for is a singleton return type, a tuple with one element. Try:
For singleton return types, there is a shortcut method as well which unwraps the return Tuple for you and infers the type of the one element:
|
I've got problem with creation function that returns struct array.
My function looks like: getPoolsInfo(address[]) then the output is array of structs. Struct has fields: address, string, string
I tried to create function like this:
val f = Function("getPoolsInfo(address[])", "(address,string,string)[]")
But ide is screaming that it cannot cast arraytype to tupletype.
Can you tell me how to construct this function properly?
The text was updated successfully, but these errors were encountered: