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

Segfault When Passing Type to struct Which Doesn't Have Type Parameter (Inner Field Does, Though) #4811

Open
dozn opened this issue Feb 8, 2025 · 0 comments

Comments

@dozn
Copy link
Contributor

dozn commented Feb 8, 2025

Context

package main
import "core:fmt"

S1 :: struct($T: typeid) { _: S2(T) }
S2 :: struct { _: proc($T: typeid) }

main :: proc() {
	s := S1(int){}
	fmt.println("SIGSEGV before we get here.")
}

Expected Behavior

Compiler error, as S2 does not accept a type, yet we're still able to pass one in.

Current Behavior

Segfault.


Odin: dev-2025-02:0683a3d67
OS: Windows 11 Professional (version: 23H2), build 22631.4751
CPU: AMD Ryzen 7 3700X 8-Core Processor
RAM: 65457 MiB
Backend: LLVM 18.1.8

@dozn dozn changed the title Segfault When Using Type Parameter With struct Which Does Not Accept a Type Parameter (But Its Field Does!) Segfault When Passing Type to struct Which Doesn't Have Type Parameter (Inner Field Does, Though) Feb 9, 2025
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