Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fixes #10

wants to merge 2 commits into from

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Sep 18, 2024

No description provided.

@edg-l edg-l changed the title Fixes and more libfuncs Fixes Sep 18, 2024
@edg-l edg-l marked this pull request as ready for review September 18, 2024 12:49
Comment on lines +91 to +92


Copy link
Collaborator

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.

Comment on lines +104 to +111
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);
Copy link
Collaborator

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?

Comment on lines +59 to +70
// 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!(),
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants