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

Compiler ignores distinct for generic types #4249

Open
FrancisTheCat opened this issue Sep 16, 2024 · 0 comments
Open

Compiler ignores distinct for generic types #4249

FrancisTheCat opened this issue Sep 16, 2024 · 0 comments

Comments

@FrancisTheCat
Copy link
Contributor

Odin:    dev-2024-09:d03d9e49a
OS:      Archcraft, Linux 6.10.8-arch1-1
CPU:     Intel(R) Core(TM) i7-9750HF CPU @ 2.60GHz
RAM:     15912 MiB
Backend: LLVM 18.1.8

Expected Behavior

Foo :: struct($T: typeid) {
    data: [4]T,
}
Int_Foo :: distinct Foo(int)

print_foo :: proc(foo: Foo($T)) {
    fmt.println(foo.data)
}

a: Foo(int)
b: Int_Foo

print_foo(a)
print_foo(b)

the last line should not compile, since the distinct just gets ignored. A specialization or cast should be required.

Current Behavior

No compiler errors.

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