hacspec icon indicating copy to clipboard operation
hacspec copied to clipboard

Named option types - None - identifier is not a constant

Open cmester0 opened this issue 4 years ago • 1 comments

The following results in a name resolution error

use hacspec_lib::*;
pub type MySingleOptionType =  Option<U32>;
pub fn bar() {
  MySingleOptionType::None;
}

the type being

error[Hacspec]: identifier is not a constant
  --> language-tests/option.rs:19:9
   |
19 |         MySingleOptionType::None;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^

cmester0 avatar Dec 15 '21 12:12 cmester0

A similar issue occurs if you do not use hacspec_lib::*; for

pub fn bar() {
  Option::<u32>::None;
}

cmester0 avatar Jan 20 '22 17:01 cmester0