dfinity / motoko

Simple high-level language for writing Internet Computer canisters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Erroneous error message

vporton opened this issue · comments

https://github.com/vporton/NacDBReorder/blob/c69e53029d1d45c0071b400e9b424c98c238027c/src/Reorder.mo#L402

            order = (actor(Principal.toText(order.canister)), order.outerKey);

In MS Code, it produces the error

field outerKey does not exist in type
  {canister : Principal}

What is a nonsense, because its type is defined as:

https://github.com/vporton/NacDBReorder/blob/c69e53029d1d45c0071b400e9b424c98c238027c/src/Reorder.mo#L346

        order: ?{canister: Principal; outerKey: Nac.OuterSubDBKey}; // TODO: To increase performace, store `OuterCanister` instead.

"Motoko" extension v0.16.0

$ moc --version
Motoko compiler 0.11.0+ (source yh3wb1vx-vj8j4j32-k8gq4m8y-4cxlqinf)

Oh, it is a "meet" of two types, my error not compiler bug.