mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-26 11:06:00 +03:00
implicit groups
This commit is contained in:
parent
90fc6a9c12
commit
431aca1f81
@ -173,6 +173,11 @@ impl FromAst<leo_ast::ValueExpression> 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()),
|
||||
|
@ -38,6 +38,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");
|
||||
|
Loading…
Reference in New Issue
Block a user