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

Monomorphiser crash (involves associated types) #62

Open
osa1 opened this issue Jan 19, 2025 · 0 comments
Open

Monomorphiser crash (involves associated types) #62

osa1 opened this issue Jan 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@osa1
Copy link
Member

osa1 commented Jan 19, 2025

trait Test[a]:
    type Item

    f1(self): Vec[Item]

impl Test for U32:
    type Item = Str

    f1(self): Vec[Item] = Vec.withCapacity(0)

main
    printStr(123u32.f1().toStr())

Output:

thread 'main' panicked at src/monomorph.rs:1094:36:
Unbound type Item

Not sure what the issue is yet, but my guess is we don't bind the associated types to mono types when monomorphising impl methods.

@osa1 osa1 added the bug Something isn't working label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant