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

[BUG] mlir types confuse overload resolution #3393

Open
helehex opened this issue Aug 17, 2024 · 2 comments
Open

[BUG] mlir types confuse overload resolution #3393

helehex opened this issue Aug 17, 2024 · 2 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@helehex
Copy link
Contributor

helehex commented Aug 17, 2024

Bug description

When a function has an overload with a mlir type, and another with a trait composition (maybe exclusive to CollectionElement?), Mojo cannot resolve the one with the mlir type.

Steps to reproduce

fn test(none: None):
    pass


fn test[T: StringableCollectionElement](x: T):
    pass


# cannot bind MLIR type 'None' to trait 'StringableCollectionElement'
fn main():
    test(None)

System information

Host Information
  ================

  Target Triple: x86_64-unknown-linux
  CPU: skylake
  CPU Features: adx, aes, avx, avx2, bmi, bmi2, clflushopt, cmov, crc32, cx16, cx8, f16c, fma, fsgsbase, fxsr, invpcid, lzcnt, mmx, movbe, pclmul, popcnt, prfchw, rdrnd, rdseed, sahf, sgx, sse, sse2, sse3, sse4.1, sse4.2, ssse3, x87, xsave, xsavec, xsaveopt, xsaves

mojo 2024.8.1705 (3a3097f5)

modular 0.8.0 (39a426b5)
@helehex helehex added bug Something isn't working mojo-repo Tag all issues with this label labels Aug 17, 2024
@helehex
Copy link
Contributor Author

helehex commented Aug 17, 2024

It also happens with __mlir_type.`i1` and a corresponding __mlir_attr.`0:i1` .

@msaelices
Copy link
Contributor

This issue is affecting this PR: #3521

I've workaround it here: msaelices@f836400

Thanks, @helehex, for pointing me to this issue and the workaround needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants