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 Panic) Non specified generic parameters can throw a runtime assert instead of error #4849

Open
speechfreedoms opened this issue Feb 15, 2025 · 0 comments

Comments

@speechfreedoms
Copy link

speechfreedoms commented Feb 15, 2025

reference: #4850

minimal example

package main
import sa "core:container/small_array"
import "core:fmt"
main :: proc() {
	arr: sa.Small_Array(10, int)
	example :: proc(p_arr: ^sa.Small_Array(10, int)) -> (result: sa.Small_Array) { // should have put size on the result
		sa.append(p_arr, 4, 5, 6, 7)
		return p_arr^
	}
	result := example(&arr)
	fmt.println(result)
}

// this only appears when you import the type directly, below works (per ElegantBeef)

Issue: Non specified generic parameters can throw a runtime assert instead of error - compiler panics and halts with message:

              \Odin\src\llvm_backend_general.cpp(1725): Assertion Failure: type != t_invalid

See:

GB_ASSERT(type != t_invalid);

Desired

Compiler should error (if possible) in this case

compiler command

odin run . or odin build .

system info

Odin 2025-02
Windows
LLVM 18.1.8

suggested labels

Compiler failure
LLVM backend
Error messaging

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