Skip to content
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

Fix ty() for reference #273

Closed
chenyan-dfinity opened this issue Sep 3, 2021 · 1 comment · Fixed by #408
Closed

Fix ty() for reference #273

chenyan-dfinity opened this issue Sep 3, 2021 · 1 comment · Fixed by #408
Labels
bug Something isn't working Rust

Comments

@chenyan-dfinity
Copy link
Contributor

The current design of Func and Service cannot produce correct implementation of ty(), because you cannot decide the type for Func::ty(). ty() for references is only defined at the value level, not at the type level.

Two possible solutions:

  1. Use closure and trait to represent function and service references
  2. Special case on ty() when it's a reference. But it breaks compositionally...
@chenyan-dfinity chenyan-dfinity added bug Something isn't working Rust labels Sep 3, 2021
Daniel-Bloom-dfinity added a commit to Daniel-Bloom-dfinity/agent-rs that referenced this issue Mar 17, 2022
With a little elbow grease we can even get around `Func`'s limitations.

We use `Type::Empty` because args subtype in the opposite direction.
ericswanson-dfinity pushed a commit to dfinity/agent-rs that referenced this issue Mar 17, 2022
* fix: workaround for dfinity/candid#273
With a little elbow grease we can even get around `Func`'s limitations.

We use `Type::Empty` because args subtype in the opposite direction.
@lastmjs
Copy link
Contributor

lastmjs commented Jun 22, 2022

Any ETA on this? I'm about to embark on implementing this generally in Azle and wondering if this might come out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants