/// Construct a dummy value for the given value type.
Construct a dummy value for the given value type.
Construct a dummy value for the given value type .
pub fn dummy_value(val_ty: ValType) -> Result<Val, Trap> {
    Ok(match val_ty {
        ValType::I32 => Val::I32(0),
        ValType::I64 => Val::I64(0),
        ValType::F32 => Val::F32(0),
        ValType::F64 => Val::F64(0),
        ValType::V128 => {
            return Err(Trap::new(
                "dummy_value: unsupported function return type: v128".to_string(),
            ))
        }
        ValType::ExternRef => {
            return Err(Trap::new(
                "dummy_value: unsupported function return type: externref".to_string(),
            ))
        }
        ValType::FuncRef => {
            return Err(Trap::new(
                "dummy_value: unsupported function return type: funcref".to_string(),
            ))
        }
    })
}
pub fn dummy_value ( val_ty : ValType ) -> Result < Val , Trap > { Ok ( match val_ty { ValType :: I32 => Val :: I32 ( 0 ) , ValType :: I64 => Val :: I64 ( 0 ) , ValType :: F32 => Val :: F32 ( 0 ) , ValType :: F64 => Val :: F64 ( 0 ) , ValType :: V128 => { return Err ( Trap :: new ( " " . to_string ( ) , ) ) } ValType :: ExternRef => { return Err ( Trap :: new ( " " . to_string ( ) , ) ) } ValType :: FuncRef => { return Err ( Trap :: new ( " " . to_string ( ) , ) ) } } ) }
Construct a dummy value for the given value type.
Construct a dummy value for the given value type .
val_ty
ValType