NilFoundation / zkllvm-rslang

Other
15 stars 2 forks source link

Support `as` conversions for field types in compiler #46

Open aleasims opened 1 year ago

aleasims commented 1 year ago

You must be able to convert unsigned integers to fields:

123u64 as __zkllvm_field_bls12381_base

Probably since we can handle negative field literals, we could also handle signed integer conversions:

-456i64 as __zkllvm_field_bls12381_base

This will allow to complete implementation of Into trait for field types.