Skip to content

Implicits break when resolved to the same function. #33

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

Open
m-kurtenacker opened this issue Apr 4, 2025 · 0 comments
Open

Implicits break when resolved to the same function. #33

m-kurtenacker opened this issue Apr 4, 2025 · 0 comments

Comments

@m-kurtenacker
Copy link
Contributor

Example code:

implicit fn(f32) -> f32 = @|a| { a };
implicit fn(f16) -> f32 = @|a| { a as f32 };
fn convert_manual (a : f16) { a as f32 }

fn foo[A, B](a : &[A], b : &[B], implicit convert_A: fn(A) -> f32, implicit convert_B: fn(B) -> f32) {
    for _ in range(0, 42) {
        convert_A(a(0));
    }

    convert_B(b(0));
}

#[export]
fn bar (a : &[f16], b : &[f16]) -> () {
    foo[f16, f16](a, b);
}

This triggers artic: thorin/src/thorin/analyses/scope.cpp:93: void thorin::Scope::verify(): Assertion `cont_scope.has_free_params()' failed.. The IR obtained using --emit-thorin also looks broken, i.e. the function bar is not printed.

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

No branches or pull requests

1 participant