What's the right syntax for let icrc_token_canister = actor ("r7inp-6aaaa-aaaaa-aaabq-cai") : ICRCTypes.TokenInterface and ICRCTypes.TokenInterfaceExtension;

let icrc_token_canister = actor ("r7inp-6aaaa-aaaaa-aaabq-cai") : ICRCTypes.TokenInterface;

works fine.

The problem is the “and” operator. It doesn’t join them into a single, flat set of services:

let icrc_token_canister = actor ("r7inp-6aaaa-aaaaa-aaabq-cai") : ICRCTypes.TokenInterface and ICRCTypes.TokenInterfaceExtension;

What’s the correct syntax to achieve this?

I’m reluctant to create a single ICRCTypes.JointTokenInterface due to code repetition / interference with processes that use existing types like ICRCTypes.TokenInterface.

Maybe try parens around it? I usually put the descriptor on the variable declaration side.

It may be that “and” typing doesn’t work with function definitions.

2 Likes

let icrc_token_canister = actor ("r7inp-6aaaa-aaaaa-aaabq-cai") : (ICRCTypes.TokenInterface and ICRCTypes.TokenInterfaceExtension);

worked marvels.

2 Likes