diff --git a/asg/src/expression/constant.rs b/asg/src/expression/constant.rs index 084ebf160a..c0d0465d8e 100644 --- a/asg/src/expression/constant.rs +++ b/asg/src/expression/constant.rs @@ -173,6 +173,11 @@ impl FromAst for Constant { span: Some(span.clone()), value: ConstValue::Field(value.parse().map_err(|_| AsgConvertError::invalid_int(&value, span))?), }, + Some(PartialType::Type(Type::Group)) => Constant { + parent: RefCell::new(None), + span: Some(span.clone()), + value: ConstValue::Group(GroupValue::Single(value.to_string())), + }, Some(PartialType::Type(Type::Address)) => Constant { parent: RefCell::new(None), span: Some(span.clone()), diff --git a/asg/tests/pass/group/mod.rs b/asg/tests/pass/group/mod.rs index 74c24f5853..58514957dd 100644 --- a/asg/tests/pass/group/mod.rs +++ b/asg/tests/pass/group/mod.rs @@ -22,6 +22,16 @@ fn test_one() { load_asg(program_string).unwrap(); } +#[test] +fn test_implicit() { + let program_string = r#" + function main() { + let element: group = 0; + } + "#; + load_asg(program_string).unwrap(); +} + #[test] fn test_zero() { let program_string = include_str!("zero.leo");