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] rebind being too lenient #3564

Open
soraros opened this issue Sep 29, 2024 · 1 comment
Open

[BUG] rebind being too lenient #3564

soraros opened this issue Sep 29, 2024 · 1 comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@soraros
Copy link
Contributor

soraros commented Sep 29, 2024

Bug description

Type equity is not always guaranteed. @lattner suggested on Discord that it's not the intended behaviour.

Steps to reproduce

fn main():
  a = Int64(0)
  b = rebind[UInt64](a)  # compiles 

System information

Mojo 2024.9.2905 (d72d1fbc) on Docker, Intel Mac
@soraros soraros added bug Something isn't working mojo-repo Tag all issues with this label labels Sep 29, 2024
@lattner
Copy link
Collaborator

lattner commented Sep 29, 2024

Hrm, interesting issue. The problem is that we are lowering away declared type information /before/ we get to instantiation. This means that Int and UInt end up looking like "just a bag of i64". It isn't great that we allow this, but probably not the end of the world. @Mogball just fyi

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