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

Add handling of polymorphic constants #604

Merged
merged 5 commits into from
Aug 27, 2024

Conversation

clarus
Copy link
Collaborator

@clarus clarus commented Aug 26, 2024

Here is an example of polymorphic constant in Rust:

fn print_array<T: std::fmt::Debug, const N: usize>(arr: [T; N]) {
    println!("{:?}", arr);
}

fn main() {
    let arr1 = [1, 2, 3];
    let arr2 = [4, 5, 6, 7, 8];

    print_array(arr1);
    print_array(arr2);

    let char_arr: [char; 3] = ['a', 'b', 'c'];
    print_array(char_arr);
}

Here, the polymorphic constant is N. In this pull request, we add such parameters with the same handling as for polymorphic types, which are also represented as values in Coq.

The aim is to be able to compile the Move Sui project that depends on such a feature to compile.

@clarus clarus changed the title Draft: add handling of polymorphic constants Add handling of polymorphic constants Aug 27, 2024
@clarus
Copy link
Collaborator Author

clarus commented Aug 27, 2024

Fixes #496

@clarus clarus merged commit 6310221 into main Aug 27, 2024
1 check passed
@clarus clarus deleted the guillaume-claret@add-handling-of-polymorphic-constants branch August 27, 2024 17:58
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.

1 participant