Internal compiler error: Unsupported instruction as struct value for field expression

Hello, please help, I wrote dapp2dapp interaction in my contract, and the compiler throws such an error, please help me figure out what’s wrong

fn get_price(asset: ContractId, price_feed: ContractId) -> u64 {
    abi(Oracle, price_feed.value).get_price(asset).price
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Internal compiler error: Unsupported instruction as struct value for field expression. ContractCall { return_type: Struct(Aggregate(Index { index: 116, generation: 0 })), name: "get_price", params: Value(Index { index: 217, generation: 0 }), coins: Value(Index { index: 218, generation: 0 }), asset_id: Value(Index { index: 219, generation: 0 }), gas: Value(Index { index: 220, generation: 0 }) }
Please file an issue on the repository and include the code that triggered this error.

The line where the error occurs:

1 Like

Interesting! Yeah an “Internal Compiler Error” almost always indicates a compiler bug. Good catch. I assume that a valid workaround would be:

let caller = abi(Oracle, price_feed.value);
caller.get_price(assert).price

If that’s indeed the problem, then I can file an issue and we can address it asap.

1 Like

Error is the same

   --> /Users/alexey/projects/fuel/sway-lend/contracts/market/src/main.sw:196:5
    |
194 | 
195 |     let caller = abi(Oracle, price_feed.value);
196 |     caller.get_price(asset).price
    |     ^^^^^^^^^^^^^^^^^^^^^^^ Internal compiler error: Unsupported instruction as struct value for field expression. ContractCall { return_type: Struct(Aggregate(Index { index: 116, generation: 0 })), name: "get_price", params: Value(Index { index: 217, generation: 0 }), coins: Value(Index { index: 218, generation: 0 }), asset_id: Value(Index { index: 219, generation: 0 }), gas: Value(Index { index: 220, generation: 0 }) }
Please file an issue on the repository and include the code that triggered this error.
197 | }
    |
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.