Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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] Can't use SIMD data types as keys for Dicts #3455

Closed
schtschenok opened this issue Sep 7, 2024 · 2 comments
Closed

[BUG] Can't use SIMD data types as keys for Dicts #3455

schtschenok opened this issue Sep 7, 2024 · 2 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@schtschenok
Copy link

Bug description

Can't use SIMD data types (UInt8, Int16, etc.) as Dict keys despite that SIMD seems to fit KeyElement requirements.

Steps to reproduce

from collections import Dict

var map1 = Dict[Int, UInt8]()  # Works
var map2 = Dict[UInt8, UInt8]()  # Doesn't work

System information

Ubuntu 22.04.4 LTS running in WSL on Windows 11 24H2
mojo 24.4.0 (59977802)
modular 0.9.2 (b3079bd5)
@schtschenok schtschenok added bug Something isn't working mojo-repo Tag all issues with this label labels Sep 7, 2024
@jjvraw
Copy link
Contributor

jjvraw commented Sep 8, 2024

SIMD's __eq__/__ne__ methods returns a bool SIMD vector, which differs to the conformance of EqualityComparable, of which KeyElement inherits

Copy link
Collaborator

Yep, this is working as intended right now, even though it's unfortunate. There's other tracking issues for making SIMD regular (so that its eq and ne would return a Bool and thus compose nicely).

@JoeLoser JoeLoser closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
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

3 participants