Skip to main content

E0046: Is-Check Requires Utxo Type

The if x is AbiType syntax can only be used when x has a Utxo type (Utxo or a named utxo type). Using it on other types (integers, booleans, structs, etc.) is a type error.

Example (error)

fn test(x: i64) {
if x is MyAbi { // Error: x has type i64, not Utxo
}
}

Fix

Ensure the variable has a Utxo type:

fn test(x: Utxo) {
if x is MyAbi { // OK
}
}