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

LLVM panic at compilation when parapoly type is incorrect #4294

Open
tymbaca opened this issue Sep 23, 2024 · 0 comments · May be fixed by #4607
Open

LLVM panic at compilation when parapoly type is incorrect #4294

tymbaca opened this issue Sep 23, 2024 · 0 comments · May be fixed by #4607

Comments

@tymbaca
Copy link

tymbaca commented Sep 23, 2024

Context

  • Please paste odin report output:
        Odin:    dev-2024-08-nightly:8359995
        OS:      macOS Sonoma 14.3.1 (build: 23D2057, kernel: 23.3.0)
        CPU:     Apple M3
        RAM:     16384 MiB
        Backend: LLVM 18.1.8

Expected Behavior

Compiler will print normal error message.

Current Behavior

I get LLVM panic

Failure Information (for bugs)

Steps to Reproduce

Run this:

package main

Container :: struct($T: typeid) {
	item: T,
}

new_container :: proc() -> Container($T) {
	return Container(T){}
}

main :: proc() {
	c := new_container()
}

Failure Logs

src/llvm_backend_proc.cpp(72): Panic: new_container :: proc() -> Container($T) (was parapoly: 1 1)
make: *** [run] Trace/BPT trap: 5
zen3ger added a commit to zen3ger/Odin that referenced this issue Dec 22, 2024
Disallow the declaration of new parapoly variables in return types, when
the procedure's parapoly scope is itself. This happens if e.g.:
`foo :: proc() -> $T`.

Closes odin-lang#3949, odin-lang#4294, odin-lang#4563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants