Closed crusso closed 3 years ago
Reported on slack by Nicolas Zoghb
https://dfinity.slack.com/archives/C016X3LCSLB/p1603147616015100
Awaiting more detailed repro
Reading the Slack thread this seems related to Candid's handling of Word types, and not really typing? Is this covered by #1824 @crusso?
Yes, I think we can close this issue - its not a bug, just a misunderstanding about how candid works.
Copying my answers from Slack:
For 1) what I suspect might be happening is that you have a canister, A, using Word8 in its Motoko interface, and are using it from another Motoko canister, B, via import C "canister:A". The Word8 will be exported as Candid nat8 (Candid doesn't have a word8 type but uses nat8 for Word8 and well as Nat8) and then imported in the second canister as a Motoko Nat8 leading to the confusion. Basically, the mapping from Motoko types to Candid types is many-to-one, but mapping from Candid to Motoko types is one-to-one, so composing the two can lead to surprises.
1) Will go away if do #1824 (removing word types).
For 2):
actor A {
public func f() : () {
await async {};
};
}
If 2) was an instance of the above that's actually ok. Motoko supports oneway methods that can't be awaited, but can send messages and await their results. This is an instance of that and is shorthand for:
actor A {
public shared func f() : () {
await async {};
};
}