-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #10
Conversation
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't pass a formatting check.
let const_field_type = match &field_type { | ||
CoreTypeConcrete::Const(inner) => inner, | ||
_ => unreachable!(), | ||
}; | ||
|
||
let field_value = | ||
inner(registry, &const_field_type.inner_ty, &const_field_type.inner_data); | ||
fields.push(field_value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between this and the previous code? Why is this better?
// Copied from the sierra to casm lowering | ||
// NonZero is the same type as the inner type in native. | ||
[GenericArg::Type(inner_ty)] => { | ||
let inner_type = registry.get_type(inner_ty).unwrap(); | ||
let const_inner_type = match inner_type { | ||
CoreTypeConcrete::Const(inner) => inner, | ||
_ => unreachable!(), | ||
}; | ||
|
||
inner(registry, &const_inner_type.inner_ty, &const_inner_type.inner_data) | ||
} | ||
_ => unreachable!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't it just recursively call inner?
No description provided.