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

Assigning a poly proc to a global var causes complier assertion #4574

Closed
blob1807 opened this issue Dec 13, 2024 · 0 comments · Fixed by #4608
Closed

Assigning a poly proc to a global var causes complier assertion #4574

blob1807 opened this issue Dec 13, 2024 · 0 comments · Fixed by #4608

Comments

@blob1807
Copy link
Contributor

blob1807 commented Dec 13, 2024

Context

Odin:    dev-2024-12:0a29d36aa
OS:      Windows 11 Home Basic (version: 23H2), build 22631.4602
CPU:     AMD Ryzen 7 6800HS with Radeon Graphics
RAM:     15608 MiB
Backend: LLVM 18.1.8

Expected Behavior

I would assume this shouldn't be allowed in the first place cause you're not resolving the poly at the decloration.

Current Behavior

Running the given code the complier crashes with a src\check_expr.cpp(468): Assertion Failure: `base_entity->kind == Entity_Procedure`

GB_ASSERT(base_entity->kind == Entity_Procedure);

Steps to Reproduce

  1. Copy Paste
  2. Run
  3. Profit???
package main

import "core:fmt"

add :: proc (a, b: $T) -> T {
    return a + b
}

sum := add

main :: proc() {
    fmt.println(sum(1, 2))
}
@blob1807 blob1807 changed the title Assigning a poly proc to a global causes complier assertion Assigning a poly proc to a global var causes complier assertion Dec 13, 2024
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

Successfully merging a pull request may close this issue.

1 participant