joshua | Flow (2024-02-08)
Is it possible to borrow a contract as one of its interface types if I know the contract's name and address? like this:
I tried it and I am getting an error:
6 Replies
I've created a thread for your message. Please continue any relevant discussion in this thread.
You can rename this thread using
/title <new title>
If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadenceUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
thanks! I assumed contract interfaces had the same syntax as resource interfaces. seems weird that they don't
yeah, that's not really how it's supposed to work. hmm
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
the "cannot restrict using non-resource/structure interface type" error is just an unnecessarily restrictive check in the type checker, not sure if 1.0 is better there
https://github.com/onflow/cadence/issues/3088
https://github.com/onflow/cadence/pull/3089
https://github.com/onflow/cadence/pull/3090