noname icon indicating copy to clipboard operation
noname copied to clipboard

Hint ite statements

Open 0xnullifier opened this issue 1 year ago • 1 comments

@katat I think I could not explain things in the issue so I have raised a draft pull request. For the example of if_else.no taken in the pr it works as the blocks early returns but if I change the example to something like this:

hint fn ite(xx: Field , arr: [Field;LEN]) -> Field {
    let mut var = 0;
    if xx == 10 {
        var = xx;
        for idx in 0..LEN {
            var = var + arr[idx];
        }
        var = xx * var;
    } else {
       var = xx * xx;
    }
    return var;
}

this causes the then_branch return type to panic. So how can I support these type of statements? moreover what about only if statements?

0xnullifier avatar Jan 25 '25 23:01 0xnullifier

@katat hey sorry for the delay I am a little busy with some work this week. I will pick this up again after the weekend

0xnullifier avatar Jan 30 '25 03:01 0xnullifier